Fix two pattern matching related warnings

master
Jonas Platte 2020-07-11 20:57:01 +02:00
parent a607d70371
commit ffc5204109
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 9 additions and 12 deletions

View File

@ -30,16 +30,13 @@ impl EventEmitter for AutoJoinBot {
return;
}
match room {
SyncRoom::Invited(room) => {
let room = room.read().await;
println!("Autojoining room {}", room.display_name());
self.client
.join_room_by_id(&room.room_id)
.await
.expect("Can't join room");
}
_ => (),
if let SyncRoom::Invited(room) = room {
let room = room.read().await;
println!("Autojoining room {}", room.display_name());
self.client
.join_room_by_id(&room.room_id)
.await
.expect("Can't join room");
}
}
}

View File

@ -727,8 +727,8 @@ impl BaseClient {
let mut olm = self.olm.lock().await;
if let Some(o) = &mut *olm {
if let Some(decrypted) =
o.decrypt_room_event(&encrypted_event, room_id).await.ok()
if let Ok(decrypted) =
o.decrypt_room_event(&encrypted_event, room_id).await
{
if let Ok(d) = decrypted.deserialize() {
e = d