Skip to content

Commit

Permalink
feat: sort tables when dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowee committed Jul 4, 2023
1 parent 7c46f87 commit 01d6f9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ fn main() -> Result<()> {

if dump_table {
secondary_builder = secondary_builder.tables(get_builtin_tables(variant));
for (from, to) in secondary_builder.build_mapping() {
let mut pairs: Vec<(String, String)> =
secondary_builder.build_mapping().into_iter().collect();
pairs.sort_by(|a, b| a.0.len().cmp(&b.0.len()).then(a.0.cmp(&b.0)));
for (from, to) in pairs {
println!("{} {}", from, to);
}
return Ok(());
Expand Down

0 comments on commit 01d6f9e

Please sign in to comment.