File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
crates/matrix-sdk-base/src/store Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ pub(crate) struct Store {
142142 session_meta : Arc < OnceCell < SessionMeta > > ,
143143 /// The current sync token that should be used for the next sync call.
144144 pub ( super ) sync_token : Arc < RwLock < Option < String > > > ,
145+ /// All rooms the store knows about.
145146 rooms : Arc < StdRwLock < BTreeMap < OwnedRoomId , Room > > > ,
146147 /// A lock to synchronize access to the store, such that data by the sync is
147148 /// never overwritten.
@@ -203,7 +204,7 @@ impl Store {
203204
204205 /// Get all the rooms this store knows about.
205206 pub fn get_rooms ( & self ) -> Vec < Room > {
206- self . rooms . read ( ) . unwrap ( ) . keys ( ) . filter_map ( |id| self . get_room ( id ) ) . collect ( )
207+ self . rooms . read ( ) . unwrap ( ) . values ( ) . cloned ( ) . collect ( )
207208 }
208209
209210 /// Get all the rooms this store knows about, filtered by state.
You can’t perform that action at this time.
0 commit comments