From: Scott Worley Date: Thu, 24 Oct 2024 17:53:42 +0000 (-0700) Subject: Plumb config into render_leftover() X-Git-Tag: v0.6.0~4 X-Git-Url: http://git.scottworley.com/tablify/commitdiff_plain/1ca87bfadfa61703dde1cfc224cec881a68a4f56?ds=inline Plumb config into render_leftover() --- diff --git a/src/lib.rs b/src/lib.rs index 5077590..3f3dde5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -340,7 +340,7 @@ fn render_cell(config: &Config, col: &str, row: &mut Row) -> HTML { )) } -fn render_leftover(notcol: &str, instances: &[Option]) -> HTML { +fn render_leftover(config: &Config, notcol: &str, instances: &[Option]) -> HTML { 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() - .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::>() .join(", "),