pub fn process_file_lines<F>(
file_name: &str,
f: F,
) -> Result<(), Box<dyn Error>>Expand description
Processes each line of a file with a given function.
§Arguments
file_name- The path to the file to process.f- A function to apply to each line of the file.
§Returns
A Result indicating success or an error if the file could not be read.
§Examples
let mut i: i32 = 1;
let _ = ys1r::io::process_file_lines("Cargo.toml", |line| {
println!("{}: {}", i, line.replace("y", "Y"));
i += 1;
});