This commit is contained in:
elvis
2025-09-17 00:34:18 +02:00
parent d458787a81
commit 83923b80e5
10 changed files with 116 additions and 80 deletions

View File

@ -8,13 +8,18 @@ pub enum UserErrorTypes {
impl Display for UserErrorTypes {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NumberTooBigUsize =>
write!(f, "Specified number is too big (greater than {})",
usize::MAX),
Self::NumberTooBigi64 =>
write!(f, "Specified number is too big (lesser than {} or \
| Self::NumberTooBigUsize => write!(
f,
"Specified number is too big (greater than {})",
usize::MAX
),
| Self::NumberTooBigi64 => write!(
f,
"Specified number is too big (lesser than {} or \
greater than {})",
i64::MIN, i64::MAX),
i64::MIN,
i64::MAX
),
}
}
}

View File

@ -5,6 +5,7 @@ pub mod user_error {
}
lalrpop_util::lalrpop_mod!(
#[allow(clippy::uninlined_format_args)] pub grammar, // name of module
#[allow(clippy::uninlined_format_args)]
#[allow(clippy::type_complexity)] pub grammar, // name of module
"/grammar.rs" // location of parser
);