refactor(crypto): Simplify the Curve25519 check when fetching a device

Co-authored-by: Jonas Platte <jplatte@matrix.org>
This commit is contained in:
Damir Jelić
2022-08-15 11:16:17 +02:00
parent 405c3938b7
commit 0bd58a7741

View File

@@ -379,7 +379,7 @@ impl Store {
) -> Result<Option<Device>> {
self.get_user_devices(user_id)
.await
.map(|d| d.devices().find(|d| d.curve25519_key().map_or(false, |k| k == curve_key)))
.map(|d| d.devices().find(|d| d.curve25519_key() == Some(curve_key)))
}
/// Get all devices associated with the given `user_id`