pub fn name(self, name: &'a str) -> Parser<'a, I, O>
	where
		O: 'a,
	{
		Parser::new(
			move |input: &'a [I], start: usize| match (self.method)(input, start) {
				res @ Ok(_) => res,
				Err(err) => match err {
					Error::Custom { .. } => Err(err),
					_ => Err(Error::Custom {
						message: format!("failed to parse {}", name),
						position: start,
						inner: Some(Box::new(err)),
					}),
				},
			},
		)
	}
/// Give parser a name to identify parsing errors.
Give parser a name to identify parsing errors.
Give parser a name to identify parsing errors .
pub fn name(self, name: &'a str) -> Parser<'a, I, O>
	where
		O: 'a,
	{
		Parser::new(
			move |input: &'a [I], start: usize| match (self.method)(input, start) {
				res @ Ok(_) => res,
				Err(err) => match err {
					Error::Custom { .. } => Err(err),
					_ => Err(Error::Custom {
						message: format!("failed to parse {}", name),
						position: start,
						inner: Some(Box::new(err)),
					}),
				},
			},
		)
	}
pub fn name ( self , name : & ' a str ) -> Parser < ' a , I , O > where O : ' a , { Parser :: new ( move | input : & ' a [ I ] , start : usize | match ( self . method ) ( input , start ) { res @ Ok ( _ ) => res , Err ( err ) => match err { Error :: Custom { .. } => Err ( err ) , _ => Err ( Error :: Custom { message : format ! ( " " name ) , position : start , inner : Some ( Box :: new ( err ) ) , } ) , } , } , ) }
Give parser a name to identify parsing errors.
Give parser a name to identify parsing errors .
self
name
&'a str