-impl From<&str> for Entry {
- fn from(value: &str) -> Entry {
- match value.split_once(':') {
- None => Entry {
- col: String::from(value),
- instance: None,
- },
- Some((col, instance)) => Entry {
- col: String::from(col.trim()),
- instance: Some(String::from(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())),
+ }