@@ -161,7 +161,7 @@ impl MemoryStore {
161
161
* self . private_identity . write ( ) . unwrap ( ) = private_identity;
162
162
}
163
163
164
- /// Return all the [' InboundGroupSession' ]s we have, paired with the
164
+ /// Return all the [` InboundGroupSession` ]s we have, paired with the
165
165
/// `backed_up_to` value for each one (or "" where it is missing, which
166
166
/// should never happen).
167
167
async fn get_inbound_group_sessions_and_backed_up_to (
@@ -340,8 +340,9 @@ impl CryptoStore for MemoryStore {
340
340
. filter ( |( _, o) | o. as_ref ( ) . is_some_and ( |o| o. as_str ( ) == backup_version) )
341
341
. count ( )
342
342
} else {
343
- // We asked about a nonexistent backup version - this doesn't make much sense, but we
344
- // can easily answer that nothing is backed up in this nonexistent backup.
343
+ // We asked about a nonexistent backup version - this doesn't make much sense,
344
+ // but we can easily answer that nothing is backed up in this
345
+ // nonexistent backup.
345
346
0
346
347
} ;
347
348
@@ -379,19 +380,21 @@ impl CryptoStore for MemoryStore {
379
380
let mut inbound_group_sessions_backed_up_to =
380
381
self . inbound_group_sessions_backed_up_to . write ( ) . unwrap ( ) ;
381
382
382
- for ( room_id, session_id) in room_and_session_ids {
383
+ for & ( room_id, session_id) in room_and_session_ids {
383
384
let session = self . inbound_group_sessions . get ( room_id, session_id) ;
385
+
384
386
if let Some ( session) = session {
385
387
session. mark_as_backed_up ( ) ;
386
388
387
389
inbound_group_sessions_backed_up_to
388
- . entry ( ( * room_id) . to_owned ( ) )
390
+ . entry ( room_id. to_owned ( ) )
389
391
. or_default ( )
390
- . insert ( ( * session_id) . to_owned ( ) , BackupVersion :: from ( backup_version) ) ;
392
+ . insert ( session_id. to_owned ( ) , BackupVersion :: from ( backup_version) ) ;
391
393
392
394
self . inbound_group_sessions . add ( session) ;
393
395
}
394
396
}
397
+
395
398
Ok ( ( ) )
396
399
}
397
400
@@ -583,6 +586,7 @@ mod tests {
583
586
use ruma:: { room_id, user_id, RoomId } ;
584
587
use vodozemac:: { Curve25519PublicKey , Ed25519PublicKey } ;
585
588
589
+ use super :: SessionId ;
586
590
use crate :: {
587
591
identities:: device:: testing:: get_device,
588
592
olm:: {
@@ -592,8 +596,6 @@ mod tests {
592
596
store:: { memorystore:: MemoryStore , Changes , CryptoStore , PendingChanges } ,
593
597
} ;
594
598
595
- use super :: SessionId ;
596
-
597
599
#[ async_test]
598
600
async fn test_session_store ( ) {
599
601
let ( account, session) = get_account_and_session_test_helper ( ) ;
0 commit comments