From a6232152575ba8fcdbdc72f36893b4e19fa2a884 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 20 Mar 2024 22:13:48 +0100 Subject: [PATCH] chore(sdk): Make Clippy happy. --- crates/matrix-sdk/src/event_cache/mod.rs | 4 ++-- crates/matrix-sdk/tests/integration/event_cache.rs | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/matrix-sdk/src/event_cache/mod.rs b/crates/matrix-sdk/src/event_cache/mod.rs index 5d4c22480..ffca4908c 100644 --- a/crates/matrix-sdk/src/event_cache/mod.rs +++ b/crates/matrix-sdk/src/event_cache/mod.rs @@ -685,7 +685,7 @@ impl RoomEventCacheInner { // (backward). The `RoomEvents` API expects the first event to be the oldest. .rev() .cloned() - .map(|timeline_event| SyncTimelineEvent::from(timeline_event)); + .map(SyncTimelineEvent::from); // There is a `token`/gap, let's replace it by new events! if let Some(gap_identifier) = gap_identifier { @@ -755,7 +755,7 @@ impl RoomEventCacheInner { max_wait: Option, ) -> Result> { // Optimistically try to return the backpagination token immediately. - fn get_oldest(room_events: RwLockReadGuard) -> Option { + fn get_oldest(room_events: RwLockReadGuard<'_, RoomEvents>) -> Option { room_events.chunks().find_map(|chunk| match chunk.content() { ChunkContent::Gap(gap) => Some(gap.prev_token.clone()), ChunkContent::Items(..) => None, diff --git a/crates/matrix-sdk/tests/integration/event_cache.rs b/crates/matrix-sdk/tests/integration/event_cache.rs index e4ac43808..54b4b3854 100644 --- a/crates/matrix-sdk/tests/integration/event_cache.rs +++ b/crates/matrix-sdk/tests/integration/event_cache.rs @@ -509,11 +509,7 @@ async fn test_reset_while_backpaginating() { let rec = room_event_cache.clone(); let first_token_clone = first_token.clone(); - let backpagination = spawn(async move { - let ret = rec.backpaginate(20, first_token_clone).await; - - ret - }); + let backpagination = spawn(async move { rec.backpaginate(20, first_token_clone).await }); // Receive the sync response (which clears the timeline). mock_sync(&server, sync_response_body, None).await;