rev_lines
rev_lines copied to clipboard
[Q] Is it possible to use rev_lines and the regular order interchangeably?
I'm trying to do the following:
let lines = if something_is_true {
RevLines::new(BufReader::new(file)).unwrap()
} else {
BufReader::new(file).lines()
};
However, this is not a valid Rust syntax since the types are incompatible for the if
and else
arm. Any suggestions?