diff --git a/examples/json/parser_partial.rs b/examples/json/parser_partial.rs index b1a61f25..864f7b2b 100644 --- a/examples/json/parser_partial.rs +++ b/examples/json/parser_partial.rs @@ -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; diff --git a/src/_topic/nom.rs b/src/_topic/nom.rs index ac7fad11..7da29a6d 100644 --- a/src/_topic/nom.rs +++ b/src/_topic/nom.rs @@ -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) //! } //! ``` //! diff --git a/src/binary/bits/mod.rs b/src/binary/bits/mod.rs index 14e743e7..aea815c2 100644 --- a/src/binary/bits/mod.rs +++ b/src/binary/bits/mod.rs @@ -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; diff --git a/src/combinator/core.rs b/src/combinator/core.rs index b1dfdfa3..8f91c970 100644 --- a/src/combinator/core.rs +++ b/src/combinator/core.rs @@ -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::*; @@ -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; diff --git a/src/parser.rs b/src/parser.rs index 8a13373d..d3f4aa92 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -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); diff --git a/src/token/mod.rs b/src/token/mod.rs index c472226a..c48c73d4 100644 --- a/src/token/mod.rs +++ b/src/token/mod.rs @@ -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) /// # } /// ``` /// @@ -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(("", ""))); /// ``` @@ -1081,7 +1081,7 @@ where /// # use winnow::prelude::*;; /// pub fn rest_len(input: &mut &str) -> PResult /// # { -/// # winnow::combinator::rest_len.parse_next(input) +/// # winnow::token::rest_len.parse_next(input) /// # } /// ``` /// @@ -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))); /// ```