Skip to content

Commit

Permalink
refactor: Update to new rest location
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 3, 2025
1 parent 2d67e86 commit 5d6a64e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/json/parser_partial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use winnow::prelude::*;
use winnow::{
ascii::float,
combinator::alt,
combinator::{cut_err, rest},
combinator::cut_err,
combinator::{delimited, preceded, separated_pair, terminated},
combinator::{repeat, separated},
error::{AddContext, ParserError, StrContext},
stream::Partial,
token::{any, none_of, take, take_while},
token::{any, none_of, rest, take, take_while},
};

use crate::json::JsonValue;
Expand Down
2 changes: 1 addition & 1 deletion src/_topic/nom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
//! # use winnow::prelude::*;
//! fn foo<'i>(i: &mut &'i str) -> PResult<&'i str> {
//! // ...
//! # winnow::combinator::rest.parse_next(i)
//! # winnow::token::rest.parse_next(i)
//! }
//! ```
//!
Expand Down
2 changes: 1 addition & 1 deletion src/binary/bits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ where
/// use winnow::prelude::*;
/// use winnow::Bytes;
/// use winnow::binary::bits::{bits, bytes, take};
/// use winnow::combinator::rest;
/// use winnow::token::rest;
/// use winnow::error::InputError;
///
/// type Stream<'i> = &'i Bytes;
Expand Down
4 changes: 2 additions & 2 deletions src/combinator/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ where
/// ```rust
/// # use winnow::{error::ErrMode, error::ErrorKind, error::InputError};
/// # use winnow::token::one_of;
/// # use winnow::token::rest;
/// # use winnow::ascii::digit1;
/// # use winnow::combinator::rest;
/// # use winnow::combinator::alt;
/// # use winnow::combinator::preceded;
/// # use winnow::prelude::*;
Expand All @@ -265,8 +265,8 @@ where
/// # use winnow::{error::ErrMode, error::ErrorKind, error::InputError};
/// # use winnow::prelude::*;
/// # use winnow::token::one_of;
/// # use winnow::token::rest;
/// # use winnow::ascii::digit1;
/// # use winnow::combinator::rest;
/// # use winnow::combinator::alt;
/// # use winnow::combinator::preceded;
/// use winnow::combinator::cut_err;
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ where
let start_token = input.checkpoint();
let result = (
self.by_ref(),
crate::combinator::eof.resume_after(rest.void()),
crate::combinator::eof.resume_after(crate::token::rest.void()),
)
.parse_next(&mut input);

Expand Down
8 changes: 4 additions & 4 deletions src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ where
/// # use winnow::prelude::*;;
/// pub fn rest<'i>(input: &mut &'i str) -> PResult<&'i str>
/// # {
/// # winnow::combinator::rest.parse_next(input)
/// # winnow::token::rest.parse_next(input)
/// # }
/// ```
///
Expand All @@ -1053,7 +1053,7 @@ where
/// # use winnow::prelude::*;
/// # use winnow::error::ErrorKind;
/// # use winnow::error::InputError;
/// use winnow::combinator::rest;
/// use winnow::token::rest;
/// assert_eq!(rest::<_,InputError<_>>.parse_peek("abc"), Ok(("", "abc")));
/// assert_eq!(rest::<_,InputError<_>>.parse_peek(""), Ok(("", "")));
/// ```
Expand Down Expand Up @@ -1081,7 +1081,7 @@ where
/// # use winnow::prelude::*;;
/// pub fn rest_len(input: &mut &str) -> PResult<usize>
/// # {
/// # winnow::combinator::rest_len.parse_next(input)
/// # winnow::token::rest_len.parse_next(input)
/// # }
/// ```
///
Expand All @@ -1091,7 +1091,7 @@ where
/// # use winnow::prelude::*;
/// # use winnow::error::ErrorKind;
/// # use winnow::error::InputError;
/// use winnow::combinator::rest_len;
/// use winnow::token::rest_len;
/// assert_eq!(rest_len::<_,InputError<_>>.parse_peek("abc"), Ok(("abc", 3)));
/// assert_eq!(rest_len::<_,InputError<_>>.parse_peek(""), Ok(("", 0)));
/// ```
Expand Down

0 comments on commit 5d6a64e

Please sign in to comment.