diff --git a/crates/toml_edit/src/parser/document.rs b/crates/toml_edit/src/parser/document.rs index f66082f6..fdcad76a 100644 --- a/crates/toml_edit/src/parser/document.rs +++ b/crates/toml_edit/src/parser/document.rs @@ -5,7 +5,6 @@ use winnow::combinator::eof; use winnow::combinator::opt; use winnow::combinator::peek; use winnow::combinator::repeat; -use winnow::error::FromExternalError; use winnow::token::any; use winnow::token::one_of; @@ -57,11 +56,7 @@ pub(crate) fn document(input: Input<'_>) -> IResult, Document, Context .into_document() .map(|document| (i, document)) .map_err(|err| { - winnow::error::ErrMode::Backtrack(ContextError::from_external_error( - i, - winnow::error::ErrorKind::Verify, - err, - )) + winnow::error::ErrMode::from_external_error(i, winnow::error::ErrorKind::Verify, err) }) } diff --git a/crates/toml_edit/src/parser/mod.rs b/crates/toml_edit/src/parser/mod.rs index 7ed57ca9..37a86d9a 100644 --- a/crates/toml_edit/src/parser/mod.rs +++ b/crates/toml_edit/src/parser/mod.rs @@ -77,6 +77,7 @@ pub(crate) mod prelude { pub(crate) use super::errors::StrContext; pub(crate) use super::errors::StrContextValue; pub(crate) use winnow::combinator::dispatch; + pub(crate) use winnow::error::FromExternalError; pub(crate) use winnow::IResult; pub(crate) use winnow::Parser; @@ -120,12 +121,10 @@ pub(crate) mod prelude { if self.current < 128 { Ok(self) } else { - Err(winnow::error::ErrMode::Backtrack( - winnow::error::FromExternalError::from_external_error( - input, - winnow::error::ErrorKind::Eof, - super::errors::CustomError::RecursionLimitExceeded, - ), + Err(winnow::error::ErrMode::from_external_error( + input, + winnow::error::ErrorKind::Eof, + super::errors::CustomError::RecursionLimitExceeded, )) } }