Skip to content

Commit

Permalink
fix(error)!: Update ErrMode::into_inner to match trait
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 29, 2025
1 parent 24aa8b3 commit b2beb6f
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 @@ -177,10 +177,10 @@ impl<E> ErrMode<E> {
///
/// Returns `None` for [`ErrMode::Incomplete`]
#[inline(always)]
pub fn into_inner(self) -> Option<E> {
pub fn into_inner(self) -> Result<E, Self> {
match self {
ErrMode::Backtrack(e) | ErrMode::Cut(e) => Some(e),
ErrMode::Incomplete(_) => None,
ErrMode::Backtrack(e) | ErrMode::Cut(e) => Ok(e),
err @ ErrMode::Incomplete(_) => Err(err),
}
}
}
Expand Down

0 comments on commit b2beb6f

Please sign in to comment.