Skip to content

Commit

Permalink
fmt: adjust the Display impl for ParseError
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz authored Aug 5, 2023
1 parent ee838ee commit a58a546
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ pub enum ParseError {
impl fmt::Display for ParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ParseError::InvalidCharacter((idx, char)) => write!(
f,
"lexical error; invalid character '{}' at {}",
char, idx
),
ParseError::InvalidCharacter((idx, char)) => {
write!(f, "lexical error; invalid character '{}' at {}", char, idx)
}
ParseError::InvalidExpression => write!(f, "syntax error; the expression is invalid"),
ParseError::EmptyExpression => write!(f, "syntax error; the expression is empty"),
}
Expand Down

0 comments on commit a58a546

Please sign in to comment.