Skip to content

Commit

Permalink
perf(error): Lower ErrMode's overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 17, 2023
1 parent 8b918ce commit 15e8ddb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ impl<E> ErrMode<E> {
}

impl<I, E: ParseError<I>> ParseError<I> for ErrMode<E> {
#[inline]
#[inline(always)]
fn from_error_kind(input: I, kind: ErrorKind) -> Self {
ErrMode::Backtrack(E::from_error_kind(input, kind))
}

#[cfg_attr(debug_assertions, track_caller)]
#[inline]
#[inline(always)]
fn assert(input: I, message: &'static str) -> Self
where
I: crate::lib::std::fmt::Debug,
Expand Down Expand Up @@ -272,7 +272,7 @@ impl<I, EXT, E> FromExternalError<I, EXT> for ErrMode<E>
where
E: FromExternalError<I, EXT>,
{
#[inline]
#[inline(always)]
fn from_external_error(input: I, kind: ErrorKind, e: EXT) -> Self {
ErrMode::Backtrack(E::from_external_error(input, kind, e))
}
Expand Down

0 comments on commit 15e8ddb

Please sign in to comment.