pub fn parse(content: &str) -> Vec<(HashSet<&str>, HashSet<&str>)> {
    content.lines().map(|line| {
        let mut parts = line.split(" (contains ");
        let ingredients: HashSet<_> = parts.next().expect("No ingredients")
            .split(" ").collect();
        let allergens: HashSet<_> = parts.next()
            .map(|part| part[..part.len() - 1].split(", ").collect())
            .unwrap_or(HashSet::new());
        (ingredients, allergens)
    }).collect()
}
/// parse content in a vector of tuples (ingredients, allergens)
parse content in a vector of tuples (ingredients, allergens)
parse content in a vector of tuples ( ingredients allergens )
pub fn parse(content: &str) -> Vec<(HashSet<&str>, HashSet<&str>)> {
    content.lines().map(|line| {
        let mut parts = line.split(" (contains ");
        let ingredients: HashSet<_> = parts.next().expect("No ingredients")
            .split(" ").collect();
        let allergens: HashSet<_> = parts.next()
            .map(|part| part[..part.len() - 1].split(", ").collect())
            .unwrap_or(HashSet::new());
        (ingredients, allergens)
    }).collect()
}
pub fn parse ( content : & str ) -> Vec < ( HashSet < & str > , HashSet < & str > ) > { content . lines ( ) . map ( | line | { let mut parts = line . split ( " " ) ; let ingredients : HashSet < _ > = parts . next ( ) . expect ( " " ) . split ( " " ) . collect ( ) ; let allergens : HashSet < _ > = parts . next ( ) . map ( | part | part [ .. part . len ( ) - 1 ] . split ( " " ) . collect ( ) ) . unwrap_or ( HashSet :: new ( ) ) ; ( ingredients , allergens ) } ) . collect ( ) }
parse content in a vector of tuples (ingredients, allergens)
parse content in a vector of tuples ( ingredients allergens )
content
&str
content
&str