Function normalize_line_endings::normalized [] [src]

pub fn normalized<I>(iter: I) -> Normalized<I> where
    I: Iterator<Item = char>, 

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"
);