Skip to content

Commit a44b52e

Browse files
authored
Fix documented examples to not use the deprecated is_alphabetic function (#1807)
1 parent 8ac26e9 commit a44b52e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bytes/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ where
278278
/// ```rust
279279
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
280280
/// use nom::bytes::complete::take_while;
281-
/// use nom::character::is_alphabetic;
281+
/// use nom::AsChar;
282282
///
283283
/// fn alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
284-
/// take_while(is_alphabetic)(s)
284+
/// take_while(AsChar::is_alpha)(s)
285285
/// }
286286
///
287287
/// assert_eq!(alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));
@@ -314,10 +314,10 @@ where
314314
/// ```rust
315315
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
316316
/// use nom::bytes::streaming::take_while1;
317-
/// use nom::character::is_alphabetic;
317+
/// use nom::AsChar;
318318
///
319319
/// fn alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
320-
/// take_while1(is_alphabetic)(s)
320+
/// take_while1(AsChar::is_alpha)(s)
321321
/// }
322322
///
323323
/// assert_eq!(alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));
@@ -349,10 +349,10 @@ where
349349
/// ```rust
350350
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
351351
/// use nom::bytes::streaming::take_while_m_n;
352-
/// use nom::character::is_alphabetic;
352+
/// use nom::AsChar;
353353
///
354354
/// fn short_alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
355-
/// take_while_m_n(3, 6, is_alphabetic)(s)
355+
/// take_while_m_n(3, 6, AsChar::is_alpha)(s)
356356
/// }
357357
///
358358
/// assert_eq!(short_alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));

0 commit comments

Comments
 (0)