mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
stop putting comments in the middle of call chains
`rustfmt` doesn't handle this very well.
This commit is contained in:
parent
1911ad34d9
commit
05be778fbb
10 changed files with 35 additions and 38 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue