Skip to content

Commit f6ce98d

Browse files
committed
Remove an unnecessary closure.
And avoid collecting into a `Vec` unnecessarily.
1 parent 51bcadb commit f6ce98d

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
@@ -601,20 +601,13 @@ pub fn write_summary_table(
601601
}
602602
result.push_str("|\n");
603603

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

0 commit comments

Comments
 (0)