From c3094bbc896653799b20ed9498e449e70d14a7ba Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 20 Dec 2024 10:33:27 +0100 Subject: [PATCH] refactor(sdk): Rename two variables. --- crates/matrix-sdk/src/event_cache/room/mod.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/matrix-sdk/src/event_cache/room/mod.rs b/crates/matrix-sdk/src/event_cache/room/mod.rs index 3ac7278a3ff..93c30e7513c 100644 --- a/crates/matrix-sdk/src/event_cache/room/mod.rs +++ b/crates/matrix-sdk/src/event_cache/room/mod.rs @@ -561,11 +561,15 @@ impl RoomEventCacheInner { }) .await?; - let mut cache = self.all_events.write().await; - for ev in &sync_timeline_events { - if let Some(event_id) = ev.event_id() { - self.append_related_event(&mut cache, ev); - cache.events.insert(event_id.to_owned(), (self.room_id.clone(), ev.clone())); + let mut all_events = self.all_events.write().await; + + for sync_timeline_event in &sync_timeline_events { + if let Some(event_id) = sync_timeline_event.event_id() { + self.append_related_event(&mut all_events, sync_timeline_event); + all_events.events.insert( + event_id.to_owned(), + (self.room_id.clone(), sync_timeline_event.clone()), + ); } }