Skip to content

Commit

Permalink
Restore parsing error: error introducer
Browse files Browse the repository at this point in the history
  • Loading branch information
CAD97 committed Aug 16, 2022
1 parent 8fbf5da commit 5aa9ff2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pest/src/error.rs
Expand Up @@ -526,7 +526,10 @@ impl<R: RuleType> fmt::Display for Error<R> {

impl<R: RuleType> fmt::Display for ErrorVariant<R> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.message())
match self {
ErrorVariant::ParsingError { .. } => write!(f, "parsing error: {}", self.message()),
ErrorVariant::CustomError { .. } => write!(f, "{}", self.message()),
}
}
}

Expand Down

0 comments on commit 5aa9ff2

Please sign in to comment.