Fix nightly clippy::unnecessary-sort-by.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -905,7 +905,7 @@ pub(super) async fn last_active(&self, limit: Option<usize>) -> Result {
|
||||
.ready_filter(|(ts, _)| ts.get() > uint!(0))
|
||||
.collect::<Vec<_>>()
|
||||
.map(|mut vec| {
|
||||
vec.sort_by(|a, b| b.0.cmp(&a.0));
|
||||
vec.sort_by_key(|k| cmp::Reverse(k.0));
|
||||
vec
|
||||
})
|
||||
.map(Vec::into_iter)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std::cmp;
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use futures::{
|
||||
@@ -328,7 +330,7 @@ pub(crate) async fn get_public_rooms_filtered_helper(
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
all_rooms.sort_by(|l, r| r.num_joined_members.cmp(&l.num_joined_members));
|
||||
all_rooms.sort_by_key(|r| cmp::Reverse(r.num_joined_members));
|
||||
|
||||
let total_room_count_estimate = UInt::try_from(all_rooms.len())
|
||||
.unwrap_or_else(|_| uint!(0))
|
||||
|
||||
Reference in New Issue
Block a user