Skip to content

Commit 1a18017

Browse files
committed
style: don't use a large outer Ok with ? in it
1 parent 508a88f commit 1a18017

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crates/matrix-sdk-crypto/src/gossiping/machine.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl GossipMachine {
313313
let device =
314314
self.inner.store.get_device(&event.sender, &event.content.requesting_device_id).await?;
315315

316-
Ok(if let Some(device) = device {
316+
if let Some(device) = device {
317317
if device.user_id() == self.user_id() {
318318
if device.is_verified() {
319319
info!(
@@ -338,7 +338,7 @@ impl GossipMachine {
338338
Ok(None)
339339
}
340340
Err(e) => Err(e),
341-
}?
341+
}
342342
} else {
343343
info!(
344344
user_id = ?device.user_id(),
@@ -347,7 +347,7 @@ impl GossipMachine {
347347
"Received a secret request that we won't serve, the device isn't trusted",
348348
);
349349

350-
None
350+
Ok(None)
351351
}
352352
} else {
353353
info!(
@@ -357,7 +357,7 @@ impl GossipMachine {
357357
"Received a secret request that we won't serve, the device doesn't belong to us",
358358
);
359359

360-
None
360+
Ok(None)
361361
}
362362
} else {
363363
warn!(
@@ -374,8 +374,8 @@ impl GossipMachine {
374374
.mark_user_as_changed(&event.sender)
375375
.await?;
376376

377-
None
378-
})
377+
Ok(None)
378+
}
379379
}
380380

381381
/// Try to encrypt the given `InboundGroupSession` for the given `Device` as

crates/matrix-sdk-crypto/src/identities/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ impl ReadOnlyDevice {
651651
}
652652
} else {
653653
warn!(
654-
"Trying to find a Olm session of a device, but the device doesn't have a \
654+
"Trying to find an Olm session of a device, but the device doesn't have a \
655655
Curve25519 key",
656656
);
657657

0 commit comments

Comments
 (0)