Skip to content

Commit e8fe4bc

Browse files
committed
fix(types): use sort_by_key per clippy unnecessary_sort_by
1 parent 2a74984 commit e8fe4bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

nodedb-types/src/approx/spacesaving.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl SpaceSaving {
5555
.iter()
5656
.map(|(&item, &(count, error))| (item, count, error))
5757
.collect();
58-
result.sort_by(|a, b| b.1.cmp(&a.1));
58+
result.sort_by_key(|item| std::cmp::Reverse(item.1));
5959
result
6060
}
6161

0 commit comments

Comments
 (0)