]> git.scottworley.com Git - tablify/commitdiff
in render_row: name 'cells'
authorScott Worley <scottworley@scottworley.com>
Thu, 26 Sep 2024 00:43:45 +0000 (17:43 -0700)
committerScott Worley <scottworley@scottworley.com>
Wed, 2 Oct 2024 09:40:47 +0000 (02:40 -0700)
src/lib.rs

index 47e1d3a9eb1fa10fac60a16cf66153b55d5d725f..357a7eec0afc72411c76398b124c9cf47d16ed76 100644 (file)
@@ -226,12 +226,12 @@ fn render_cell(col: &str, row: &mut Row) -> HTML {
 
 fn render_row(columns: &[String], row: &mut Row) -> HTML {
     let row_label = HTML::escape(row.label.as_ref());
 
 fn render_row(columns: &[String], row: &mut Row) -> HTML {
     let row_label = HTML::escape(row.label.as_ref());
+    let cells = columns
+        .iter()
+        .map(|col| render_cell(col, row))
+        .collect::<HTML>();
     HTML(format!(
     HTML(format!(
-        "<tr><th id=\"{row_label}\">{row_label}</th>{}</tr>\n",
-        &columns
-            .iter()
-            .map(|col| render_cell(col, row))
-            .collect::<HTML>()
+        "<tr><th id=\"{row_label}\">{row_label}</th>{cells}</tr>\n"
     ))
 }
 
     ))
 }