InputLine::Blank if self.row.is_some() => {
return Ok(std::mem::take(&mut self.row).map(Rowlike::Row)).transpose()
}
- InputLine::Blank => {}
+ InputLine::Blank => return Some(Ok(Rowlike::Spacer)),
InputLine::Entry(col, instance) => match &mut self.row {
None => {
return Some(Err(std::io::Error::other(format!(
})
]
);
+ assert_eq!(
+ read_rows(&b"foo\n\n\nbar\n"[..])
+ .flatten()
+ .collect::<Vec<_>>(),
+ vec![
+ Rowlike::Row(Row {
+ label: "foo".to_owned(),
+ entries: HashMap::new(),
+ }),
+ Rowlike::Spacer,
+ Rowlike::Row(Row {
+ label: "bar".to_owned(),
+ entries: HashMap::new(),
+ })
+ ]
+ );
assert_eq!(
read_rows(&b"foo\n \nbar\n"[..])
.flatten()