refactor(base): Remove SlidingSync::get_room.

This patch removes the `SlidingSync::get_room` method. The goal is to
remove `SlidingSyncRoom`.
This commit is contained in:
Ivan Enderlin
2025-05-14 17:17:59 +02:00
parent 21de891ea5
commit 52c38ec44d
2 changed files with 0 additions and 10 deletions

View File

@@ -394,8 +394,6 @@ async fn create_one_room(
assert!(update.rooms.contains(&room_id.to_owned()));
let _room = sliding_sync.get_room(room_id).await.context("`get_room`")?;
Ok(())
}
@@ -404,9 +402,6 @@ async fn timeline_test_helper(
sliding_sync: &SlidingSync,
room_id: &RoomId,
) -> Result<(Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>>)> {
let sliding_sync_room = sliding_sync.get_room(room_id).await.unwrap();
let room_id = sliding_sync_room.room_id();
let sdk_room = client.get_room(room_id).ok_or_else(|| {
anyhow::anyhow!("Room {room_id} not found in client. Can't provide a timeline for it")
})?;

View File

@@ -180,11 +180,6 @@ impl SlidingSync {
}
}
/// Lookup a specific room
pub async fn get_room(&self, room_id: &RoomId) -> Option<SlidingSyncRoom> {
self.inner.rooms.read().await.get(room_id).cloned()
}
/// Check the number of rooms.
pub fn get_number_of_rooms(&self) -> usize {
self.inner.rooms.blocking_read().len()