diff --git a/examples/custom_error.rs b/examples/custom_error.rs index a728a7ec..0f184fd5 100644 --- a/examples/custom_error.rs +++ b/examples/custom_error.rs @@ -21,10 +21,6 @@ impl ParserError for CustomError { fn from_error_kind(input: &I, kind: ErrorKind) -> Self { CustomError::Winnow(input.clone(), kind) } - - fn append(self, _: &I, _: &::Checkpoint, _: ErrorKind) -> Self { - self - } } impl AddContext for CustomError { diff --git a/src/combinator/tests.rs b/src/combinator/tests.rs index 8916f599..f955c96b 100644 --- a/src/combinator/tests.rs +++ b/src/combinator/tests.rs @@ -122,10 +122,6 @@ impl ParserError for CustomError { fn from_error_kind(_: &I, _: ErrorKind) -> Self { CustomError } - - fn append(self, _: &I, _: &::Checkpoint, _: ErrorKind) -> Self { - CustomError - } } struct CustomError; @@ -3464,9 +3460,6 @@ impl ParserError for NilError { fn from_error_kind(_: &I, _: ErrorKind) -> NilError { NilError } - fn append(self, _: &I, _: &::Checkpoint, _: ErrorKind) -> NilError { - NilError - } } #[test] diff --git a/src/error.rs b/src/error.rs index 01c8d031..d3424cde 100644 --- a/src/error.rs +++ b/src/error.rs @@ -294,7 +294,15 @@ pub trait ParserError: Sized { /// /// This is useful when backtracking through a parse tree, accumulating error context on the /// way. - fn append(self, input: &I, token_start: &::Checkpoint, kind: ErrorKind) -> Self; + #[inline] + fn append( + self, + _input: &I, + _token_start: &::Checkpoint, + _kind: ErrorKind, + ) -> Self { + self + } /// Combines errors from two different parse branches. /// @@ -407,16 +415,6 @@ impl ParserError for InputError { kind, } } - - #[inline] - fn append( - self, - _input: &I, - _token_start: &::Checkpoint, - _kind: ErrorKind, - ) -> Self { - self - } } impl AddContext for InputError {} @@ -487,15 +485,6 @@ impl std::error::E impl ParserError for () { #[inline] fn from_error_kind(_: &I, _: ErrorKind) -> Self {} - - #[inline] - fn append( - self, - _input: &I, - _token_start: &::Checkpoint, - _kind: ErrorKind, - ) -> Self { - } } impl AddContext for () {} @@ -582,21 +571,6 @@ impl ParserError for ContextError { fn from_error_kind(_input: &I, _kind: ErrorKind) -> Self { Self::new() } - - #[inline] - fn append( - self, - _input: &I, - _token_start: &::Checkpoint, - _kind: ErrorKind, - ) -> Self { - self - } - - #[inline] - fn or(self, other: Self) -> Self { - other - } } impl AddContext for ContextError { @@ -1134,16 +1108,6 @@ impl ParserError for ErrorKind { fn from_error_kind(_input: &I, kind: ErrorKind) -> Self { kind } - - #[inline] - fn append( - self, - _input: &I, - _token_start: &::Checkpoint, - _kind: ErrorKind, - ) -> Self { - self - } } impl AddContext for ErrorKind {}