Skip to content

Commit 18dfc21

Browse files
committed
Remove an unnecessary closure.
And avoid collecting into a `Vec` unnecessarily.
1 parent 27e726b commit 18dfc21

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

site/src/comparison.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -602,20 +602,13 @@ pub fn write_summary_table(
602602
}
603603
result.push_str("|\n");
604604

605-
let mut render_row = |row: Vec<String>| {
606-
debug_assert_eq!(row.len(), column_labels.len());
607-
for (column, &count) in row.into_iter().zip(&counts) {
605+
for row in 0..5 {
606+
let row_data = column_data.iter().map(|rows| rows[row].clone());
607+
debug_assert_eq!(row_data.len(), column_labels.len());
608+
for (column, &count) in row_data.zip(&counts) {
608609
write!(result, "| {:<1$} ", column, count).unwrap();
609610
}
610611
result.push_str("|\n");
611-
};
612-
613-
for row in 0..5 {
614-
let row_data = column_data
615-
.iter()
616-
.map(|rows| rows[row].clone())
617-
.collect::<Vec<_>>();
618-
render_row(row_data);
619612
}
620613
}
621614

0 commit comments

Comments
 (0)