Skip to content

Commit 8ea1d5f

Browse files
committed
Change take_while doc example to use nom::bytes::take_while
1 parent a44b52e commit 8ea1d5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bytes/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ where
276276
/// takes the input and returns a bool)*.
277277
/// # Example
278278
/// ```rust
279-
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
280-
/// use nom::bytes::complete::take_while;
279+
/// # use nom::{Err, error::ErrorKind, Needed, Parser, IResult};
280+
/// use nom::bytes::take_while;
281281
/// use nom::AsChar;
282282
///
283283
/// fn alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
284-
/// take_while(AsChar::is_alpha)(s)
284+
/// take_while(AsChar::is_alpha).parse(s)
285285
/// }
286286
///
287287
/// assert_eq!(alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));

0 commit comments

Comments
 (0)