| Crates.io | read_lines_with_blank |
| lib.rs | read_lines_with_blank |
| version | 0.1.1 |
| created_at | 2025-04-19 00:19:25.626709+00 |
| updated_at | 2025-04-19 19:45:21.693603+00 |
| description | File to Vec |
| homepage | |
| repository | https://github.com/DawsonThePagan/read_lines_with_blank |
| max_upload_size | |
| id | 1640166 |
| size | 5,111 |
Read lines from a file or string while keeping blank lines and not ending on blank lines.
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),
};