Skip to content

Commit df93cfd

Browse files
committed
Remove unnecessary Result from private function return type
1 parent f56f27a commit df93cfd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/matrix-sdk-crypto/src/olm/account.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ impl ReadOnlyAccount {
862862

863863
pub(crate) async fn signed_one_time_keys_helper(
864864
&self,
865-
) -> Result<BTreeMap<Box<DeviceKeyId>, Raw<OneTimeKey>>, ()> {
865+
) -> BTreeMap<Box<DeviceKeyId>, Raw<OneTimeKey>> {
866866
let one_time_keys = self.one_time_keys().await;
867867
let mut one_time_key_map = BTreeMap::new();
868868

@@ -897,7 +897,7 @@ impl ReadOnlyAccount {
897897
);
898898
}
899899

900-
Ok(one_time_key_map)
900+
one_time_key_map
901901
}
902902

903903
/// Generate, sign and prepare one-time keys to be uploaded.
@@ -907,7 +907,7 @@ impl ReadOnlyAccount {
907907
&self,
908908
) -> Result<BTreeMap<Box<DeviceKeyId>, Raw<OneTimeKey>>, ()> {
909909
let _ = self.generate_one_time_keys().await?;
910-
self.signed_one_time_keys_helper().await
910+
Ok(self.signed_one_time_keys_helper().await)
911911
}
912912

913913
/// Create a new session with another account given a one-time key.

crates/matrix-sdk-crypto/src/session_manager/sessions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ mod test {
412412
assert!(request.one_time_keys.contains_key(bob.user_id()));
413413

414414
bob.generate_one_time_keys_helper(1).await;
415-
let one_time = bob.signed_one_time_keys_helper().await.unwrap();
415+
let one_time = bob.signed_one_time_keys_helper().await;
416416
bob.mark_keys_as_published().await;
417417

418418
let mut one_time_keys = BTreeMap::new();
@@ -462,7 +462,7 @@ mod test {
462462
assert!(request.one_time_keys.contains_key(bob.user_id()));
463463

464464
bob.generate_one_time_keys_helper(1).await;
465-
let one_time = bob.signed_one_time_keys_helper().await.unwrap();
465+
let one_time = bob.signed_one_time_keys_helper().await;
466466
bob.mark_keys_as_published().await;
467467

468468
let mut one_time_keys = BTreeMap::new();

0 commit comments

Comments
 (0)