stop putting comments in the middle of call chains

`rustfmt` doesn't handle this very well.
This commit is contained in:
Charles Hall 2024-05-16 01:08:08 -07:00
parent 1911ad34d9
commit 05be778fbb
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
10 changed files with 35 additions and 38 deletions

View file

@ -266,7 +266,6 @@ pub(crate) async fn get_public_rooms_filtered_helper(
})
})
.transpose()?
// url is now an Option<String> so we must flatten
.flatten(),
join_rule: services()
.rooms
@ -336,7 +335,6 @@ pub(crate) async fn get_public_rooms_filtered_helper(
true
}
})
// We need to collect all, so we can sort by member count
.collect();
all_rooms.sort_by(|l, r| r.num_joined_members.cmp(&l.num_joined_members));

View file

@ -165,7 +165,7 @@ pub(crate) async fn get_message_events_route(
.user_can_see_event(sender_user, &body.room_id, &pdu.event_id)
.unwrap_or(false)
})
.take_while(|&(k, _)| Some(k) != to) // Stop at `to`
.take_while(|&(k, _)| Some(k) != to)
.collect();
for (_, event) in &events_after {
@ -217,7 +217,7 @@ pub(crate) async fn get_message_events_route(
.user_can_see_event(sender_user, &body.room_id, &pdu.event_id)
.unwrap_or(false)
})
.take_while(|&(k, _)| Some(k) != to) // Stop at `to`
.take_while(|&(k, _)| Some(k) != to)
.collect();
for (_, event) in &events_before {

View file

@ -22,9 +22,9 @@ pub(crate) async fn get_hierarchy_route(
.try_into()
.expect("0-100 should fit in usize");
// Plus one to skip the space room itself
let max_depth = usize::try_from(body.max_depth.map(|x| x.min(uint!(10))).unwrap_or(uint!(3)))
.expect("0-10 should fit in usize")
// Skip the space room itself
+ 1;
services()

View file

@ -211,7 +211,6 @@ async fn send_state_event_for_key_helper(
.rooms
.alias
.resolve_local_alias(&alias)?
// Make sure it's the right room
.filter(|room| room == room_id)
.is_none()
{

View file

@ -678,7 +678,6 @@ async fn load_joined_room(
}
})
.filter_map(Result::ok)
// Filter for possible heroes
.flatten()
{
if heroes.contains(&hero) || hero == sender_user.as_str() {