Skip to content

Commit 7ac1bf9

Browse files
committed
chore(sdk): Rename a couple of variables.
This is another clean up patch.
1 parent 4ad0bfc commit 7ac1bf9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

crates/matrix-sdk/src/event_cache/linked_chunk/as_vector.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,23 +359,23 @@ impl UpdateToVectorDiff {
359359
todo!()
360360
}
361361

362-
Update::DetachLastItems { at } => {
363-
let expected_chunk_identifier = at.chunk_identifier();
364-
let new_length = at.index();
362+
Update::DetachLastItems { at: position } => {
363+
let expected_chunk_identifier = position.chunk_identifier();
364+
let new_length = position.index();
365365

366-
let length = self
366+
let chunk_length = self
367367
.chunks
368368
.iter_mut()
369-
.find_map(|(chunk_identifier, length)| {
370-
(*chunk_identifier == expected_chunk_identifier).then_some(length)
369+
.find_map(|(chunk_identifier, chunk_length)| {
370+
(*chunk_identifier == expected_chunk_identifier).then_some(chunk_length)
371371
})
372372
// SAFETY: Assuming `LinkedChunk` and `ObservableUpdates` are not buggy, and
373373
// assuming `Self::chunks` is correctly initialized, it is not possible to
374374
// detach items from a chunk that does not exist. If this predicate fails,
375375
// it means `LinkedChunk` or `ObservableUpdates` contain a bug.
376376
.expect("Detach last items: The chunk is not found");
377377

378-
*length = new_length;
378+
*chunk_length = new_length;
379379
}
380380

381381
Update::StartReattachItems => {

0 commit comments

Comments
 (0)