<meta charset=\"utf-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
<style>
+ td { text-align: center; }
/* h/t https://wabain.github.io/2019/10/13/css-rotated-table-header.html */
th, td { white-space: nowrap; }
th { text-align: left; font-weight: normal; }
.into_iter()
.map(|(col, n)| (n, col))
.collect();
- counts.sort();
+ counts.sort_unstable_by(|(an, acol), (bn, bcol)| bn.cmp(an).then(acol.cmp(bcol)));
counts
}
fn column_order(rows: &[RowInput]) -> Vec<String> {
.collect::<Result<Vec<_>, _>>()
.unwrap()
),
- vec![(1, String::from("bar")), (2, String::from("baz"))]
+ vec![(2, String::from("baz")), (1, String::from("bar"))]
);
assert_eq!(
column_counts(
.collect::<Result<Vec<_>, _>>()
.unwrap()
),
- vec![(1, String::from("bar")), (2, String::from("baz"))]
+ vec![(2, String::from("baz")), (1, String::from("bar"))]
);
assert_eq!(
column_counts(
.collect::<Result<Vec<_>, _>>()
.unwrap()
),
- vec![(1, String::from("bar")), (2, String::from("baz"))]
+ vec![(2, String::from("baz")), (1, String::from("bar"))]
);
}