Fix lots of clippy lints

This commit is contained in:
Jonas Platte 2021-06-17 20:34:14 +02:00
parent af2ce5803e
commit f3e630c064
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
17 changed files with 140 additions and 202 deletions

View file

@ -146,11 +146,9 @@ pub async fn sync_events_route(
let since_state = since_shortstatehash
.as_ref()
.map(|since_shortstatehash| {
Ok::<_, Error>(
since_shortstatehash
.map(|since_shortstatehash| db.rooms.state_full(since_shortstatehash))
.transpose()?,
)
since_shortstatehash
.map(|since_shortstatehash| db.rooms.state_full(since_shortstatehash))
.transpose()
})
.transpose()?;
@ -255,7 +253,7 @@ pub async fn sync_events_route(
device_list_updates.extend(
db.rooms
.room_members(&room_id)
.filter_map(|user_id| Some(user_id.ok()?))
.flatten()
.filter(|user_id| {
// Don't send key updates from the sender to the sender
sender_user != user_id
@ -313,9 +311,10 @@ pub async fn sync_events_route(
Ok(None)
}
})
.filter_map(|u| u.ok()) // Filter out buggy users
// Filter out buggy users
.filter_map(|u| u.ok())
// Filter for possible heroes
.filter_map(|u| u)
.flatten()
{
if heroes.contains(&hero) || hero == sender_user.as_str() {
continue;