Flatten nested match for less indentation
This commit is contained in:
parent
ca88539ec4
commit
7aea6160c3
1 changed files with 7 additions and 11 deletions
|
@ -302,17 +302,13 @@ impl OlmMachine {
|
|||
for (user_id, user_devices) in &response.one_time_keys {
|
||||
for (device_id, key_map) in user_devices {
|
||||
let device: Device = match self.store.get_device(&user_id, device_id).await {
|
||||
Ok(d) => {
|
||||
if let Some(d) = d {
|
||||
d
|
||||
} else {
|
||||
warn!(
|
||||
"Tried to create an Olm session for {} {}, but \
|
||||
the device is unknown",
|
||||
user_id, device_id
|
||||
);
|
||||
continue;
|
||||
}
|
||||
Ok(Some(d)) => d,
|
||||
Ok(None) => {
|
||||
warn!(
|
||||
"Tried to create an Olm session for {} {}, but the device is unknown",
|
||||
user_id, device_id
|
||||
);
|
||||
continue;
|
||||
}
|
||||
Err(e) => {
|
||||
warn!(
|
||||
|
|
Loading…
Reference in a new issue