pub fn one_of<T, Input>(tokens: T) -> OneOf<T, Input>
Expand description
Extract one token and succeeds if it is part of tokens
.
let result = many(one_of("abc".chars()))
.parse("abd");
assert_eq!(result, Ok((String::from("ab"), "d")));
pub fn one_of<T, Input>(tokens: T) -> OneOf<T, Input>
Extract one token and succeeds if it is part of tokens
.
let result = many(one_of("abc".chars()))
.parse("abd");
assert_eq!(result, Ok((String::from("ab"), "d")));