matrix-sdk: Fix some newly introduced clippy warnings

This commit is contained in:
Damir Jelić 2021-05-06 20:42:27 +02:00
parent cad888e69b
commit 43b7072609
5 changed files with 8 additions and 17 deletions

View file

@ -2082,11 +2082,8 @@ impl Client {
let olm = self.base_client.olm_machine().await?;
olm.get_verification_request(flow_id).and_then(|r| {
if let Some(room) = self.get_joined_room(r.room_id()) {
Some(VerificationRequest { inner: r, room })
} else {
None
}
self.get_joined_room(r.room_id())
.map(|room| VerificationRequest { inner: r, room })
})
}

View file

@ -183,14 +183,10 @@ impl AmbiguityCache {
.and_then(|m| m.get(&member_event.state_key))
{
Some(m.clone())
} else if let Some(m) = self
.store
.get_member_event(room_id, &member_event.state_key)
.await?
{
Some(m)
} else {
None
self.store
.get_member_event(room_id, &member_event.state_key)
.await?
};
let old_display_name = if let Some(event) = old_event {

View file

@ -180,11 +180,11 @@ impl JoinedRoom {
unread_notifications: UnreadNotificationsCount,
) -> Self {
Self {
unread_notifications,
timeline,
state,
account_data,
ephemeral,
unread_notifications,
}
}
}

View file

@ -416,8 +416,8 @@ impl PrivateCrossSigningIdentity {
UploadSigningKeysRequest {
master_key,
user_signing_key,
self_signing_key,
user_signing_key,
}
}
}

View file

@ -422,10 +422,8 @@ impl Sas {
} else {
Some(r)
}
} else if let Some(r) = identity_signature_request {
Some(r)
} else {
None
identity_signature_request
};
// TODO store the request as well.