-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>();
- let leftovers = render_all_leftovers(row);
- HTML(format!(
- "<tr><th id=\"{row_label}\">{row_label}</th>{cells}<td class=\"leftover\" onmouseover=\"highlight('{row_label}')\" onmouseout=\"clear_highlight('{row_label}')\">{leftovers}</td></tr>\n"
- ))
+fn render_row(columns: &[String], rowlike: &mut Rowlike) -> HTML {
+ match rowlike {
+ Rowlike::Spacer => HTML::from("<tr><td> </td></tr>"),
+ Rowlike::Row(row) => {
+ let row_label = HTML::escape(row.label.as_ref());
+ let cells = columns
+ .iter()
+ .map(|col| render_cell(col, row))
+ .collect::<HTML>();
+ let leftovers = render_all_leftovers(row);
+ HTML(format!(
+ "<tr><th id=\"{row_label}\">{row_label}</th>{cells}<td class=\"leftover\" onmouseover=\"highlight('{row_label}')\" onmouseout=\"clear_highlight('{row_label}')\">{leftovers}</td></tr>\n"
+ ))
+ }
+ }