crypto: Fix some clippy warnings.

This commit is contained in:
Damir Jelić 2020-08-03 15:05:19 +02:00
parent a3bb8a0d74
commit e431ba0bf5
2 changed files with 6 additions and 9 deletions

View file

@ -138,11 +138,10 @@ impl VerificationMachine {
AnyToDeviceEvent::KeyVerificationMac(e) => {
if let Some(s) = self.get_sas(&e.content.transaction_id) {
self.receive_event_helper(&s, event);
if s.is_done() {
if !s.mark_device_as_verified().await? {
if let Some(r) = s.cancel() {
self.outgoing_to_device_messages.insert(r.txn_id.clone(), r);
}
if s.is_done() && !s.mark_device_as_verified().await? {
if let Some(r) = s.cancel() {
self.outgoing_to_device_messages.insert(r.txn_id.clone(), r);
}
}
};

View file

@ -162,10 +162,8 @@ impl Sas {
(content, guard.is_done())
};
if done {
if !self.mark_device_as_verified().await? {
return Ok(self.cancel());
}
if done && !self.mark_device_as_verified().await? {
return Ok(self.cancel());
}
Ok(content.map(|c| {