crypto: Fix some clippy warnings.

master
Damir Jelić 2020-10-07 17:56:29 +02:00
parent 220ccfb52b
commit 4019ebf121
1 changed files with 5 additions and 8 deletions

View File

@ -278,15 +278,12 @@ impl KeyRequestMachine {
///
/// * `device_id` - The device id of the device that got the Olm session.
pub fn retry_keyshare(&self, user_id: &UserId, device_id: &DeviceId) {
match self.users_for_key_claim.entry(user_id.to_owned()) {
Entry::Occupied(e) => {
e.get().remove(device_id);
if let Entry::Occupied(e) = self.users_for_key_claim.entry(user_id.to_owned()) {
e.get().remove(device_id);
if e.get().is_empty() {
e.remove();
}
if e.get().is_empty() {
e.remove();
}
_ => (),
}
for (key, event) in self.wait_queue.remove(user_id, device_id) {
@ -376,7 +373,7 @@ impl KeyRequestMachine {
self.handle_key_share_without_session(device, event);
return Ok(());
}
e => return Err(e.into()),
e => return Err(e),
}
}
}