Skip to content

Commit a623215

Browse files
committed
chore(sdk): Make Clippy happy.
1 parent f61de71 commit a623215

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ impl RoomEventCacheInner {
685685
// (backward). The `RoomEvents` API expects the first event to be the oldest.
686686
.rev()
687687
.cloned()
688-
.map(|timeline_event| SyncTimelineEvent::from(timeline_event));
688+
.map(SyncTimelineEvent::from);
689689

690690
// There is a `token`/gap, let's replace it by new events!
691691
if let Some(gap_identifier) = gap_identifier {
@@ -755,7 +755,7 @@ impl RoomEventCacheInner {
755755
max_wait: Option<Duration>,
756756
) -> Result<Option<PaginationToken>> {
757757
// Optimistically try to return the backpagination token immediately.
758-
fn get_oldest(room_events: RwLockReadGuard<RoomEvents>) -> Option<PaginationToken> {
758+
fn get_oldest(room_events: RwLockReadGuard<'_, RoomEvents>) -> Option<PaginationToken> {
759759
room_events.chunks().find_map(|chunk| match chunk.content() {
760760
ChunkContent::Gap(gap) => Some(gap.prev_token.clone()),
761761
ChunkContent::Items(..) => None,

crates/matrix-sdk/tests/integration/event_cache.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,7 @@ async fn test_reset_while_backpaginating() {
509509

510510
let rec = room_event_cache.clone();
511511
let first_token_clone = first_token.clone();
512-
let backpagination = spawn(async move {
513-
let ret = rec.backpaginate(20, first_token_clone).await;
514-
515-
ret
516-
});
512+
let backpagination = spawn(async move { rec.backpaginate(20, first_token_clone).await });
517513

518514
// Receive the sync response (which clears the timeline).
519515
mock_sync(&server, sync_response_body, None).await;

0 commit comments

Comments
 (0)