#[derive(PartialEq, Eq)]
pub(crate) enum EmptyLine {
Ignore
}
pub(crate) fn buf_to_strlines(buf: &Vec<u8>, el: EmptyLine) -> Vec<String> {
let sbuf = std::str::from_utf8(&buf).expect("Buffer not UTF-8");
let mut out = Vec::new();
for line in sbuf.split("\n") {
if line.len() == 0 && el == EmptyLine::Ignore {
continue;
}
out.push(line.to_string());
}
out
}