pub fn mutate(twtxt: &str, f: fn(&str) -> String) -> Vec<String>Expand description
Wrapper to apply a function to each line of a twtxt.txt file,
returning the resulting lines as a Vec<String>
ยงExamples
let input = "test\ntest";
let output = rustwtxt::mutate(input, |line| {
line.chars()
.map(|c| c.to_uppercase().to_string())
.collect::<String>()
});
assert_eq!("TEST", output[0]);