pub fn alternative(alternatives: Vec<String>) -> impl Fn(&str) -> IResult<&str, &str> {
    move |i: &str| {
        for alternative in &alternatives {
            if let done @ IResult::Ok(..) = tag(alternative.as_str())(i) {
                return done;
            }
        }
        Err(nom::Err::Error((i, ErrorKind::Tag))) // nothing found.
    }
}
/// Similar to alt, but works on a vector of tags.
Similar to alt, but works on a vector of tags.
Similar to alt but works on a vector of tags .
pub fn alternative(alternatives: Vec<String>) -> impl Fn(&str) -> IResult<&str, &str> {
    move |i: &str| {
        for alternative in &alternatives {
            if let done @ IResult::Ok(..) = tag(alternative.as_str())(i) {
                return done;
            }
        }
        Err(nom::Err::Error((i, ErrorKind::Tag))) // nothing found.
    }
}
pub fn alternative ( alternatives : Vec < String > ) -> impl Fn ( & str ) -> IResult < & str , & str > { move | i : & str | { for alternative in & alternatives { if let done @ IResult :: Ok ( .. ) = tag ( alternative . as_str ( ) ) ( i ) { return done ; } } Err ( nom :: Err :: Error ( ( i , ErrorKind :: Tag ) ) ) // nothing found. } }
Similar to alt, but works on a vector of tags.
Similar to alt but works on a vector of tags .
alternatives
Vec<String>
alternatives
Vec<String>