// Iterates over all expressions delimited by a character
// and excutes a function on each one of them
Iterates over all expressions delimited by a character
and excutes a function on each one of them
Iterates over all expressions delimited by a character and excutes a function on each one of them
fn filter<'s>(exp: &'s str, pattern: char, mut f: impl FnMut(&'s str) -> Result<(), String>) {
    if let Some((head, tail)) = split_ounce(exp, pattern) {
        match f(head) {
            Ok(_) => {
                filter(tail, pattern, f);
            }
            Err(m) => {
                if !m.is_empty() {
                    eprintln!("{}", m)
                }
            }
        }
    } else {
        match f(exp) {
            Err(m) => {
                if !m.is_empty() {
                    eprintln!("{}", m)
                }
            }
            _ => {}
        }
    }
}
fn filter < ' s > ( exp : & ' s str , pattern : char , mut f : impl FnMut ( & ' s str ) -> Result < ( ) , String > ) { if let Some ( ( head , tail ) ) = split_ounce ( exp , pattern ) { match f ( head ) { Ok ( _ ) => { filter ( tail , pattern , f ) ; } Err ( m ) => { if ! m . is_empty ( ) { eprintln ! ( " " m ) } } } } else { match f ( exp ) { Err ( m ) => { if ! m . is_empty ( ) { eprintln ! ( " " m ) } } _ => { } } } }
Iterates over all expressions delimited by a character
and excutes a function on each one of them
Iterates over all expressions delimited by a character and excutes a function on each one of them
exp
&'s str
pattern
char
f
impl FnMut(&'s str) -> Result<(), String>