Remove redundant braces

master
Jonas Platte 2020-07-25 02:32:50 +02:00
parent 14db34beee
commit d4fe2fe0a2
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
1 changed files with 13 additions and 18 deletions

View File

@ -469,11 +469,9 @@ impl BaseClient {
// a store path was provided. // a store path was provided.
if self.state_store.read().await.is_none() { if self.state_store.read().await.is_none() {
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
{ if let Some(path) = &*self.store_path {
if let Some(path) = &*self.store_path { let store = JsonStore::open(path)?;
let store = JsonStore::open(path)?; *self.state_store.write().await = Some(Box::new(store));
*self.state_store.write().await = Some(Box::new(store));
}
} }
} }
@ -719,22 +717,19 @@ impl BaseClient {
#[allow(unused_mut)] #[allow(unused_mut)]
Ok(mut e) => { Ok(mut e) => {
#[cfg(feature = "encryption")] #[cfg(feature = "encryption")]
if let AnySyncRoomEvent::Message(AnySyncMessageEvent::RoomEncrypted(
ref mut encrypted_event,
)) = e
{ {
if let AnySyncRoomEvent::Message(AnySyncMessageEvent::RoomEncrypted( let mut olm = self.olm.lock().await;
ref mut encrypted_event,
)) = e
{
let mut olm = self.olm.lock().await;
if let Some(o) = &mut *olm { if let Some(o) = &mut *olm {
if let Ok(decrypted) = if let Ok(decrypted) = o.decrypt_room_event(&encrypted_event, room_id).await
o.decrypt_room_event(&encrypted_event, room_id).await {
{ if let Ok(d) = decrypted.deserialize() {
if let Ok(d) = decrypted.deserialize() { e = d
e = d
}
*event = decrypted;
} }
*event = decrypted;
} }
} }
} }