]> git.scottworley.com Git - tablify/commitdiff
Plumb config into render_leftover()
authorScott Worley <scottworley@scottworley.com>
Thu, 24 Oct 2024 17:53:42 +0000 (10:53 -0700)
committerScott Worley <scottworley@scottworley.com>
Thu, 24 Oct 2024 17:59:18 +0000 (10:59 -0700)
src/lib.rs

index 50775908f0ce2c8bdf568a4f7415be1040ad8eba..3f3dde53e246ff290ff3e63c4970bf7ba73bddef 100644 (file)
@@ -340,7 +340,7 @@ fn render_cell(config: &Config, col: &str, row: &mut Row) -> HTML {
     ))
 }
 
     ))
 }
 
-fn render_leftover(notcol: &str, instances: &[Option<String>]) -> HTML {
+fn render_leftover(config: &Config, notcol: &str, instances: &[Option<String>]) -> HTML {
     let label = HTML::escape(notcol);
     if instances.len() == 1 && instances[0].is_none() {
         HTML(format!("{label}"))
     let label = HTML::escape(notcol);
     if instances.len() == 1 && instances[0].is_none() {
         HTML(format!("{label}"))
@@ -360,7 +360,13 @@ fn render_all_leftovers(config: &Config, row: &Row) -> HTML {
     HTML(
         order
             .into_iter()
     HTML(
         order
             .into_iter()
-            .map(|notcol| render_leftover(notcol, row.entries.get(notcol).expect("Key vanished?!")))
+            .map(|notcol| {
+                render_leftover(
+                    config,
+                    notcol,
+                    row.entries.get(notcol).expect("Key vanished?!"),
+                )
+            })
             .map(|html| html.0) // Waiting for slice_concat_trait to stabilize
             .collect::<Vec<_>>()
             .join(", "),
             .map(|html| html.0) // Waiting for slice_concat_trait to stabilize
             .collect::<Vec<_>>()
             .join(", "),