-impl<'a> From<&'a str> for Entry<'a> {
- fn from(value: &'a str) -> Entry<'a> {
- match value.split_once(':') {
- None => Entry {
- col: value,
- instance: None,
- },
- Some((col, instance)) => Entry {
- col: col.trim(),
- instance: Some(instance.trim()),
- },
+impl<'a> From<&'a str> for InputLine<'a> {
+ fn from(value: &'a str) -> InputLine<'a> {
+ let trimmed = value.trim_end();
+ if trimmed.is_empty() {
+ InputLine::Blank
+ } else if !trimmed.starts_with(' ') {
+ InputLine::RowHeader(value.trim())
+ } else {
+ match value.split_once(':') {
+ None => InputLine::Entry(value.trim(), None),
+ Some((col, instance)) => InputLine::Entry(col.trim(), Some(instance.trim())),
+ }