read_lines_with_blank

Crates.ioread_lines_with_blank
lib.rsread_lines_with_blank
version0.1.1
created_at2025-04-19 00:19:25.626709+00
updated_at2025-04-19 19:45:21.693603+00
descriptionFile to Vec by line without losing or ending on blank lines
homepage
repositoryhttps://github.com/DawsonThePagan/read_lines_with_blank
max_upload_size
id1640166
size5,111
Bailey Dawson (DawsonThePagan)

documentation

README

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),
};
Commit count: 5

cargo fmt