mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-14 11:05:32 -04:00
chore(sdk): Make Clippy happy.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user