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 {
142
142
session_meta : Arc < OnceCell < SessionMeta > > ,
143
143
/// The current sync token that should be used for the next sync call.
144
144
pub ( super ) sync_token : Arc < RwLock < Option < String > > > ,
145
+ /// All rooms the store knows about.
145
146
rooms : Arc < StdRwLock < BTreeMap < OwnedRoomId , Room > > > ,
146
147
/// A lock to synchronize access to the store, such that data by the sync is
147
148
/// never overwritten.
@@ -203,7 +204,7 @@ impl Store {
203
204
204
205
/// Get all the rooms this store knows about.
205
206
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 ( )
207
208
}
208
209
209
210
/// Get all the rooms this store knows about, filtered by state.
You can’t perform that action at this time.
0 commit comments