Skip to content

Commit

Permalink
fix: Deprecate IResult
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 22, 2025
1 parent 52c901f commit 30f464b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
13 changes: 2 additions & 11 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,8 @@ use crate::Parser;
/// - [`ErrMode::into_inner`]
pub type PResult<O, E = ContextError> = Result<O, ErrMode<E>>;

/// For use with [`Parser::parse_peek`] which allows the input stream to be threaded through a
/// parser.
///
/// - `Ok((I, O))` is the remaining [input][crate::stream] and the parsed value
/// - [`Err(ErrMode<E>)`][ErrMode] is the error along with how to respond to it
///
/// By default, the error type (`E`) is [`InputError`]
///
/// When integrating into the result of the application, see
/// - [`Parser::parse`]
/// - [`ErrMode::into_inner`]
/// Deprecated, replaced with [`PResult`]
#[deprecated(since = "0.6.25", note = "Replaced with `PResult`")]
pub type IResult<I, O, E = InputError<I>> = PResult<(I, O), E>;

#[cfg(test)]
Expand Down
5 changes: 3 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::combinator::impls;
#[cfg(feature = "unstable-recover")]
#[cfg(feature = "std")]
use crate::error::FromRecoverableError;
use crate::error::{AddContext, FromExternalError, IResult, PResult, ParseError, ParserError};
use crate::error::{AddContext, FromExternalError, PResult, ParseError, ParserError};
use crate::stream::{Compare, Location, ParseSlice, Stream, StreamIsPartial};
#[cfg(feature = "unstable-recover")]
#[cfg(feature = "std")]
Expand Down Expand Up @@ -1284,8 +1284,9 @@ where
/// Deprecated
#[inline(always)]
#[deprecated(since = "0.6.23")]
#[allow(deprecated)]
pub fn unpeek<'a, I, O, E>(
mut peek: impl FnMut(I) -> IResult<I, O, E> + 'a,
mut peek: impl FnMut(I) -> crate::error::IResult<I, O, E> + 'a,
) -> impl FnMut(&mut I) -> PResult<O, E>
where
I: Clone,
Expand Down

0 comments on commit 30f464b

Please sign in to comment.