trim_lines 0.2.0

An extremely simple and tiny library which provides an iterator over the lines of a string, trimmed of whitespace. It is a simple wrapper around the Lines iterator in std::str which trims the whitespace from each line.
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 3.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • nlburgin/trim_lines
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nlburgin

trim_lines

NOTE: This crate is deprecated. You should be using map(str::trim) instead:

fn main() {
    let text = "    foo    \r\n    bar    \n   \n    baz    \n";
    let mut lines = text.lines().map(str::trim);
    assert_eq!(Some("foo"), lines.next());
    assert_eq!(Some("bar"), lines.next());
    assert_eq!(Some(""), lines.next());
    assert_eq!(Some("baz"), lines.next());
    assert_eq!(None, lines.next());
}

An extremely simple and tiny library which provides an iterator over the lines of a string, trimmed of whitespace. It is a simple wrapper around the Lines iterator in std::str which trims the whitespace from each line.