@@ -12,7 +12,6 @@ use crate::error::ParseError;
1212use crate :: internal:: { Err , Needed , Parser } ;
1313use crate :: lib:: std:: result:: Result :: * ;
1414use crate :: traits:: { Compare , CompareResult } ;
15- use crate :: AsChar ;
1615use crate :: Check ;
1716use crate :: ExtendInto ;
1817use crate :: FindSubstring ;
@@ -23,6 +22,7 @@ use crate::Mode;
2322use crate :: OutputM ;
2423use crate :: OutputMode ;
2524use crate :: ToUsize ;
25+ use crate :: { AsChar , IntoInput } ;
2626
2727/// Recognizes a pattern.
2828///
@@ -44,11 +44,11 @@ use crate::ToUsize;
4444/// ```
4545pub fn tag < T , I , Error : ParseError < I > > ( tag : T ) -> impl Parser < I , Output = I , Error = Error >
4646where
47- I : Input + Compare < T > ,
48- T : Input + Clone ,
47+ I : Input + Compare < T :: Input > ,
48+ T : IntoInput ,
4949{
5050 Tag {
51- tag,
51+ tag : tag . into_input ( ) ,
5252 e : PhantomData ,
5353 }
5454}
@@ -113,11 +113,11 @@ where
113113/// ```
114114pub fn tag_no_case < T , I , Error : ParseError < I > > ( tag : T ) -> impl Parser < I , Output = I , Error = Error >
115115where
116- I : Input + Compare < T > ,
117- T : Input + Clone ,
116+ I : Input + Compare < T :: Input > ,
117+ T : IntoInput ,
118118{
119119 TagNoCase {
120- tag,
120+ tag : tag . into_input ( ) ,
121121 e : PhantomData ,
122122 }
123123}
@@ -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"[..])));
@@ -595,11 +595,12 @@ where
595595/// ```
596596pub fn take_until < T , I , Error : ParseError < I > > ( tag : T ) -> impl Parser < I , Output = I , Error = Error >
597597where
598- I : Input + FindSubstring < T > ,
599- T : Clone ,
598+ I : Input + FindSubstring < T :: Input > ,
599+ T : IntoInput ,
600+ T :: Input : Clone ,
600601{
601602 TakeUntil {
602- tag,
603+ tag : tag . into_input ( ) ,
603604 e : PhantomData ,
604605 }
605606}
0 commit comments