matrix-sdk: Fix some newly introduced clippy warnings

master
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?; let olm = self.base_client.olm_machine().await?;
olm.get_verification_request(flow_id).and_then(|r| { olm.get_verification_request(flow_id).and_then(|r| {
if let Some(room) = self.get_joined_room(r.room_id()) { self.get_joined_room(r.room_id())
Some(VerificationRequest { inner: r, room }) .map(|room| VerificationRequest { inner: r, room })
} else {
None
}
}) })
} }

View File

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

View File

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

View File

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

View File

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