From 65aadb3b88b9b7a128dee4e8bb279906d2427b40 Mon Sep 17 00:00:00 2001 From: Skgland Date: Sat, 24 Jan 2026 04:20:13 +0100 Subject: [PATCH] reduce visibility to pub(crate) to prevent accidentally exposing --- src/parser/ast.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parser/ast.rs b/src/parser/ast.rs index c8d046e7..05d459dd 100644 --- a/src/parser/ast.rs +++ b/src/parser/ast.rs @@ -454,7 +454,7 @@ pub struct ParserError { #[allow(dead_code)] #[derive(Debug)] #[non_exhaustive] -pub enum ParserErrorKind { +pub(crate) enum ParserErrorKind { BackQuotedString, IO(IOError), IncompleteReduction, @@ -470,11 +470,11 @@ pub enum ParserErrorKind { } impl ParserError { - pub fn location(&self) -> Option { + pub(crate) fn location(&self) -> Option { self.location.as_ref().cloned() } - pub fn as_atom(&self) -> Atom { + pub(crate) fn as_atom(&self) -> Atom { match &self.kind { ParserErrorKind::BackQuotedString => atom!("back_quoted_string"), ParserErrorKind::IncompleteReduction => atom!("incomplete_reduction"), @@ -501,7 +501,7 @@ impl ParserError { } #[inline] - pub fn unexpected_eof() -> Self { + pub(crate) fn unexpected_eof() -> Self { ParserError { location: None, kind: ParserErrorKind::IO(std::io::Error::from(ErrorKind::UnexpectedEof)), @@ -509,7 +509,7 @@ impl ParserError { } #[inline] - pub fn is_unexpected_eof(&self) -> bool { + pub(crate) fn is_unexpected_eof(&self) -> bool { if let ParserErrorKind::IO(e) = &self.kind { e.kind() == ErrorKind::UnexpectedEof } else { -- 2.54.0