refactor: Use Try operator over Into::into, fixup comment.
This commit is contained in:
@@ -357,7 +357,7 @@ pub trait CryptoStore: AsyncTraitDeps {
|
||||
) -> Result<Option<StoredRoomKeyBundleData>, Self::Error>;
|
||||
|
||||
/// Get whether we have previously downloaded all room keys for a particular
|
||||
/// from the key backup in advance of building a room key bundle.
|
||||
/// room from the key backup in advance of building a room key bundle.
|
||||
async fn has_downloaded_all_room_keys(&self, room_id: &RoomId) -> Result<bool, Self::Error>;
|
||||
|
||||
/// Get arbitrary data from the store
|
||||
|
||||
@@ -825,13 +825,13 @@ trait SqliteObjectCryptoStoreExt: SqliteAsyncConnExt {
|
||||
}
|
||||
|
||||
async fn has_downloaded_all_room_keys(&self, room_id: Key) -> Result<bool> {
|
||||
self.query_row(
|
||||
"SELECT EXISTS (SELECT 1 FROM room_key_backups_fully_downloaded WHERE room_id = ?)",
|
||||
(room_id,),
|
||||
|row| row.get(0),
|
||||
)
|
||||
.await
|
||||
.map_err(Into::into)
|
||||
Ok(self
|
||||
.query_row(
|
||||
"SELECT EXISTS (SELECT 1 FROM room_key_backups_fully_downloaded WHERE room_id = ?)",
|
||||
(room_id,),
|
||||
|row| row.get(0),
|
||||
)
|
||||
.await?)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user