Function normalize_line_endings::normalized
source · pub fn normalized(
iter: impl Iterator<Item = char>
) -> impl Iterator<Item = char>
Expand description
Take a Chars and return similar struct with normalized line endings
Example
use std::iter::FromIterator;
use normalize_line_endings::normalized;
let input = "This is a string \n with \r some \n\r\n random newlines\r\r\n\n";
assert_eq!(
&String::from_iter(normalized(input.chars())),
"This is a string \n with \n some \n\n random newlines\n\n\n"
);