]> git.scottworley.com Git - tablify/blobdiff - src/lib.rs
A place to keep per-column mark overrides
[tablify] / src / lib.rs
index 2e9c7f64522544d0ea67964a63a6d866e08c1517..50775908f0ce2c8bdf568a4f7415be1040ad8eba 100644 (file)
@@ -16,6 +16,7 @@ struct Config {
     static_columns: Vec<Option<String>>,
     hidden_columns: HashSet<String>,
     substitute_labels: HashMap<String, String>,
+    mark: HashMap<String, String>,
 }
 impl Config {
     fn apply_command(&mut self, line_num: usize, cmd: &str) -> Result<(), std::io::Error> {
@@ -60,6 +61,7 @@ impl Default for Config {
             static_columns: vec![],
             hidden_columns: HashSet::new(),
             substitute_labels: HashMap::new(),
+            mark: HashMap::new(),
         }
     }
 }
@@ -874,6 +876,7 @@ mod tests {
                     static_columns: vec![],
                     hidden_columns: HashSet::from(["private".to_owned()]),
                     substitute_labels: HashMap::new(),
+                    mark: HashMap::new(),
                 },
                 &Row {
                     label: "nope".to_owned(),
@@ -907,6 +910,7 @@ mod tests {
                     static_columns: vec![Some("foo".to_owned()), Some("bar".to_owned())],
                     hidden_columns: HashSet::new(),
                     substitute_labels: HashMap::new(),
+                    mark: HashMap::new(),
                 },
                 &["baz".to_owned()],
                 &mut Rowlike::Row(Row {
@@ -930,6 +934,7 @@ mod tests {
                     static_columns: vec![Some("foo".to_owned()), None, Some("bar".to_owned())],
                     hidden_columns: HashSet::new(),
                     substitute_labels: HashMap::new(),
+                    mark: HashMap::new(),
                 },
                 &[],
                 &mut Rowlike::Row(Row {
@@ -952,6 +957,7 @@ mod tests {
                     static_columns: vec![],
                     hidden_columns: HashSet::from(["foo".to_owned()]),
                     substitute_labels: HashMap::new(),
+                    mark: HashMap::new(),
                 },
                 &[],
                 &mut Rowlike::Row(Row {
@@ -971,6 +977,7 @@ mod tests {
                     static_columns: vec![Some("foo".to_owned())],
                     hidden_columns: HashSet::from(["foo".to_owned()]),
                     substitute_labels: HashMap::new(),
+                    mark: HashMap::new(),
                 },
                 &[],
                 &mut Rowlike::Row(Row {
@@ -990,6 +997,7 @@ mod tests {
                     static_columns: vec![],
                     hidden_columns: HashSet::new(),
                     substitute_labels: HashMap::from([("foo".to_owned(), "bar".to_owned())]),
+                    mark: HashMap::new(),
                 },
                 &["foo".to_owned()],
                 &mut Rowlike::Row(Row {