Skip to content

Commit 9ccbac0

Browse files
committed
refactor(event cache): inline and remove from public API remove_empty_chunk_at
1 parent 137fc9c commit 9ccbac0

File tree

1 file changed

+2
-15
lines changed
  • crates/matrix-sdk/src/event_cache/room

1 file changed

+2
-15
lines changed

crates/matrix-sdk/src/event_cache/room/events.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,6 @@ impl EventLinkedChunk {
9494
self.chunks.push_items_back(events);
9595
}
9696

97-
/// Remove an empty chunk at the given position.
98-
///
99-
/// Note: the chunk must either be a gap, or an empty items chunk, and it
100-
/// must NOT be the last one.
101-
///
102-
/// Returns the next insert position, if any, left after the chunk that has
103-
/// just been removed.
104-
pub fn remove_empty_chunk_at(
105-
&mut self,
106-
gap: ChunkIdentifier,
107-
) -> Result<Option<Position>, Error> {
108-
self.chunks.remove_empty_chunk_at(gap)
109-
}
110-
11197
/// Replace the gap identified by `gap_identifier`, by events.
11298
///
11399
/// Because the `gap_identifier` can represent non-gap chunk, this method
@@ -306,7 +292,8 @@ impl EventLinkedChunk {
306292
self.chunks.push_gap_back(new_gap);
307293

308294
if let Some(prev_chunk_to_remove) = prev_chunk_to_remove {
309-
self.remove_empty_chunk_at(prev_chunk_to_remove)
295+
self.chunks
296+
.remove_empty_chunk_at(prev_chunk_to_remove)
310297
.expect("we just checked the chunk is there, and it's an empty item chunk");
311298
}
312299
}

0 commit comments

Comments
 (0)