pub fn one_of<'a, I, S>(set: &'a S) -> Parser<'a, I, I>
where
	I: Clone + PartialEq + Display + Debug,
	S: Set<I> + ?Sized,
{
	Parser::new(move |input: &'a [I], start: usize| {
		if let Some(s) = input.get(start) {
			if set.contains(s) {
				Ok((s.clone(), start + 1))
			} else {
				Err(Error::Mismatch {
					message: format!("expect one of: {}, found: {}", set.to_str(), s),
					position: start,
				})
			}
		} else {
			Err(Error::Incomplete)
		}
	})
}
/// Success when current input symbol is one of the set.
Success when current input symbol is one of the set.
Success when current input symbol is one of the set .
pub fn one_of<'a, I, S>(set: &'a S) -> Parser<'a, I, I>
where
	I: Clone + PartialEq + Display + Debug,
	S: Set<I> + ?Sized,
{
	Parser::new(move |input: &'a [I], start: usize| {
		if let Some(s) = input.get(start) {
			if set.contains(s) {
				Ok((s.clone(), start + 1))
			} else {
				Err(Error::Mismatch {
					message: format!("expect one of: {}, found: {}", set.to_str(), s),
					position: start,
				})
			}
		} else {
			Err(Error::Incomplete)
		}
	})
}
pub fn one_of < ' a , I , S > ( set : & ' a S ) -> Parser < ' a , I , I > where I : Clone + PartialEq + Display + Debug , S : Set < I > + ? Sized , { Parser :: new ( move | input : & ' a [ I ] , start : usize | { if let Some ( s ) = input . get ( start ) { if set . contains ( s ) { Ok ( ( s . clone ( ) , start + 1 ) ) } else { Err ( Error :: Mismatch { message : format ! ( " " set to_str ( ) s ) , position : start , } ) } } else { Err ( Error :: Incomplete ) } } ) }
Success when current input symbol is one of the set.
Success when current input symbol is one of the set .
set
&'a S