fn apply_formatting<I, F>(iter: I, f: F) -> String
where
    I: Iterator,
    I::Item: AsRef<str>,
    F: Fn(&str) -> String,
{
    iter.fold(String::new(), |acc, x| acc + &f(x.as_ref()) + "\n")
}
// Applies a formatting function over a slice of strings,
// concatenating them on separate lines into a single String
Applies a formatting function over a slice of strings,
concatenating them on separate lines into a single String
Applies a formatting function over a slice of strings concatenating them on separate lines into a single String
fn apply_formatting<I, F>(iter: I, f: F) -> String
where
    I: Iterator,
    I::Item: AsRef<str>,
    F: Fn(&str) -> String,
{
    iter.fold(String::new(), |acc, x| acc + &f(x.as_ref()) + "\n")
}
fn apply_formatting < I , F > ( iter : I , f : F ) -> String where I : Iterator , I :: Item : AsRef < str > , F : Fn ( & str ) -> String , { iter . fold ( String :: new ( ) , | acc , x | acc + & f ( x . as_ref ( ) ) + " \n " ) }
Applies a formatting function over a slice of strings,
concatenating them on separate lines into a single String
Applies a formatting function over a slice of strings concatenating them on separate lines into a single String
iter
I
f
F
iter
I
f
F