read_lines_with_blank 0.1.1

File to Vec<String> by line without losing or ending on blank lines
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 5.11 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 249.5 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • DawsonThePagan/read_lines_with_blank
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DawsonThePagan

read_lines_with_blank

Read lines from a file or string while keeping blank lines and not ending on blank lines.

Usage

use read_lines_with_blank::*;

let f = File::open("foo.txt")?;
let mut reader = BufReader::new(f);

let lines_file = match read_lines_with_blank(&mut reader) {
    Ok(x) => x,
    Err(e) => return Err(e),
};

let str: &str = "line1\n\n\nline2\n";
let lines_str = match read_lines_with_blank_from_str(str) {
    Ok(x) => x,
    Err(e) => return Err(e),
};