Skip to content

Commit

Permalink
refactor(event cache): remove duplicated method `RoomEventCacheState:…
Browse files Browse the repository at this point in the history
…:clear()`
  • Loading branch information
bnjbvr committed Dec 18, 2024
1 parent 42fcae0 commit abb657c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/matrix-sdk/src/event_cache/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl RoomEventCache {
/// storage.
pub async fn clear(&self) -> Result<()> {
// Clear the linked chunk and persisted storage.
self.inner.state.write().await.clear().await?;
self.inner.state.write().await.reset().await?;

// Clear the (temporary) events mappings.
self.inner.all_events.write().await.clear();
Expand Down Expand Up @@ -723,14 +723,6 @@ mod private {
Ok(Self { room, store, events, waited_for_initial_prev_token: false })
}

/// Clear all cached content for this [`RoomEventCacheState`].
pub async fn clear(&mut self) -> Result<(), EventCacheError> {
self.events.reset();
self.propagate_changes().await?;
self.waited_for_initial_prev_token = false;
Ok(())
}

/// Removes the bundled relations from an event, if they were present.
///
/// Only replaces the present if it contained bundled relations.
Expand Down

0 comments on commit abb657c

Please sign in to comment.