fix(clippy): use sort_by_key in findurl (clippy 1.96 unnecessary_sort_by)
CI's stable toolchain is clippy 1.96, which flags unnecessary_sort_by that local 1.94 did not. hits.sort_by(|a,b| b.date_added.cmp(&a.date_added)) -> sort_by_key with Reverse.
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ pub fn run_find_url(args: &[String], json: bool) {
|
||||
}
|
||||
|
||||
// Most-recently-added first (date_added is microseconds since 1601).
|
||||
hits.sort_by(|a, b| b.date_added.cmp(&a.date_added));
|
||||
hits.sort_by_key(|b| std::cmp::Reverse(b.date_added));
|
||||
hits.truncate(limit);
|
||||
|
||||
if json {
|
||||
|
||||
Reference in New Issue
Block a user