chore(sdk): Make Clippy happy.

This commit is contained in:
Ivan Enderlin
2024-03-20 22:13:48 +01:00
parent f61de718b8
commit a623215257
2 changed files with 3 additions and 7 deletions

View File

@@ -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<Duration>,
) -> Result<Option<PaginationToken>> {
// Optimistically try to return the backpagination token immediately.
fn get_oldest(room_events: RwLockReadGuard<RoomEvents>) -> Option<PaginationToken> {
fn get_oldest(room_events: RwLockReadGuard<'_, RoomEvents>) -> Option<PaginationToken> {
room_events.chunks().find_map(|chunk| match chunk.content() {
ChunkContent::Gap(gap) => Some(gap.prev_token.clone()),
ChunkContent::Items(..) => None,

View File

@@ -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;