Skip to content

Commit 3495cab

Browse files
committed
refactor(common): builder::LinkedChunkBuilder::* becomes lazy_loader::*.
This patch renames the `builder` module to `lazy_loader`. The `LinkedChunkBuilder`'s methods are now functions. The `LinkedChunkBuilder` struct is removed. Finally, `LinkedChunkBuilderError` is renamed `LazyLoaderError`. The `LinkedChunkBuilderTest` struct is kept for the moment. It's going to be replaced soon.
1 parent 7a06bdb commit 3495cab

File tree

6 files changed

+175
-199
lines changed

6 files changed

+175
-199
lines changed

crates/matrix-sdk-base/src/event_cache/store/integration_tests.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use matrix_sdk_common::{
2222
VerificationState,
2323
},
2424
linked_chunk::{
25-
ChunkContent, ChunkIdentifier as CId, LinkedChunk, LinkedChunkBuilder,
26-
LinkedChunkBuilderTest, Position, RawChunk, Update,
25+
lazy_loader, ChunkContent, ChunkIdentifier as CId, LinkedChunk, LinkedChunkBuilderTest,
26+
Position, RawChunk, Update,
2727
},
2828
};
2929
use matrix_sdk_test::{event_factory::EventFactory, ALICE, DEFAULT_TEST_ROOM_ID};
@@ -448,7 +448,7 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
448448

449449
assert_eq!(chunk_identifier_generator.current(), 2);
450450

451-
let linked_chunk = LinkedChunkBuilder::from_last_chunk::<DEFAULT_CHUNK_CAPACITY, _, _>(
451+
let linked_chunk = lazy_loader::from_last_chunk::<DEFAULT_CHUNK_CAPACITY, _, _>(
452452
last_chunk,
453453
chunk_identifier_generator,
454454
)
@@ -483,8 +483,7 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
483483
// Pretend it's the first chunk.
484484
previous_chunk.previous = None;
485485

486-
let _ = LinkedChunkBuilder::insert_new_first_chunk(&mut linked_chunk, previous_chunk)
487-
.unwrap();
486+
let _ = lazy_loader::insert_new_first_chunk(&mut linked_chunk, previous_chunk).unwrap();
488487

489488
let mut rchunks = linked_chunk.rchunks();
490489

@@ -519,8 +518,7 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
519518
let previous_chunk =
520519
self.load_previous_chunk(room_id, first_chunk).await.unwrap().unwrap();
521520

522-
let _ = LinkedChunkBuilder::insert_new_first_chunk(&mut linked_chunk, previous_chunk)
523-
.unwrap();
521+
let _ = lazy_loader::insert_new_first_chunk(&mut linked_chunk, previous_chunk).unwrap();
524522

525523
let mut rchunks = linked_chunk.rchunks();
526524

0 commit comments

Comments
 (0)