Skip to content

Commit bbeb2d2

Browse files
committed
refactor(timeline): slightly rearrange code so as to remove a dubious comment
1 parent 187b646 commit bbeb2d2

File tree

1 file changed

+4
-10
lines changed
  • crates/matrix-sdk/src/event_cache/room

1 file changed

+4
-10
lines changed

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -912,21 +912,15 @@ mod private {
912912
return Ok(LoadMoreEventsBackwardsOutcome::Gap { prev_token: Some(prev_token) });
913913
}
914914

915-
// Because `first_chunk` is `not `Send`, get this information before the
916-
// `.await` point, so that this `Future` can implement `Send`.
917-
let first_chunk_identifier = self
918-
.room_linked_chunk
919-
.chunks()
920-
.next()
921-
.expect("a linked chunk is never empty")
922-
.identifier();
923-
924915
let store = self.store.lock().await?;
925916

917+
let prev_first_chunk =
918+
self.room_linked_chunk.chunks().next().expect("a linked chunk is never empty");
919+
926920
// The first chunk is not a gap, we can load its previous chunk.
927921
let linked_chunk_id = LinkedChunkId::Room(&self.room);
928922
let new_first_chunk = match store
929-
.load_previous_chunk(linked_chunk_id, first_chunk_identifier)
923+
.load_previous_chunk(linked_chunk_id, prev_first_chunk.identifier())
930924
.await
931925
{
932926
Ok(Some(new_first_chunk)) => {

0 commit comments

Comments
 (0)