Function hash_set

Source
pub fn hash_set<P, V>(parser: P) -> MapParser<P, Collect<HashSet<V>>>
where P: Parser, P::Output: IntoIterator<Item = V>,
Expand description

Convert the output of parser from a Vec<V> or other collection into a HashSet.

For example, the parser alpha+ produces a Vec<char>, so hash_set(alpha+) produces a HashSet<char>:

let p = parser!(hash_set(alpha+));

let set = p.parse("xZjZZd").unwrap();
assert_eq!(set.len(), 4); // x Z j d
assert!(set.contains(&'d'));
assert!(!set.contains(&'r'));