Skip to content

Commit

Permalink
Merge pull request #500 from Lexicality/errorcontext-bits-compatability
Browse files Browse the repository at this point in the history
Add impl `ErrorConvert` for `ContextError`
  • Loading branch information
epage authored Apr 11, 2024
2 parents 8512ab7 + 40a0a15 commit 92b008e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,13 @@ impl crate::lib::std::fmt::Display for ContextError<StrContext> {
}
}

impl<C> ErrorConvert<ContextError<C>> for ContextError<C> {
#[inline]
fn convert(self) -> ContextError<C> {
self
}
}

/// Additional parse context for [`ContextError`] added via [`Parser::context`]
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
Expand Down

0 comments on commit 92b008e

Please sign in to comment.