Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
michirakara authored and sharkdp committed Oct 2, 2024
1 parent 0ebdefe commit 9b684b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl GenericCommand for ListCommand {
let sort_order = matches.value_of("sort-order").expect("required argument");

let mut colors: Vec<&NamedColor> = NAMED_COLORS.iter().collect();
colors.sort_by_key(|nc| key_function(sort_order, &nc.color));
colors.sort_by_cached_key(|nc| key_function(sort_order, &nc.color));
colors.dedup_by(|n1, n2| n1.color == n2.color);

if config.interactive_mode {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl GenericCommand for SortCommand {
colors.dedup_by_key(|c| c.to_u32());
}

colors.sort_by_key(|c| key_function(sort_order, c));
colors.sort_by_cached_key(|c| key_function(sort_order, c));

if matches.is_present("reverse") {
colors.reverse();
Expand Down

0 comments on commit 9b684b3

Please sign in to comment.