From 98ba714b2071ebd7eb22e90b918129c01ef7bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 6 Sep 2024 13:33:47 +0200 Subject: [PATCH] sdk: Fix a clippy warning --- .../matrix-sdk/src/event_cache/linked_chunk/mod.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/crates/matrix-sdk/src/event_cache/linked_chunk/mod.rs b/crates/matrix-sdk/src/event_cache/linked_chunk/mod.rs index da4d4c9b2..644ceb097 100644 --- a/crates/matrix-sdk/src/event_cache/linked_chunk/mod.rs +++ b/crates/matrix-sdk/src/event_cache/linked_chunk/mod.rs @@ -888,11 +888,7 @@ impl<'a, const CAP: usize, Item, Gap> Iterator for IterBackward<'a, CAP, Item, G type Item = &'a Chunk; fn next(&mut self) -> Option { - self.chunk.map(|chunk| { - self.chunk = chunk.previous(); - - chunk - }) + self.chunk.inspect(|chunk| self.chunk = chunk.previous()) } } @@ -914,11 +910,7 @@ impl<'a, const CAP: usize, Item, Gap> Iterator for Iter<'a, CAP, Item, Gap> { type Item = &'a Chunk; fn next(&mut self) -> Option { - self.chunk.map(|chunk| { - self.chunk = chunk.next(); - - chunk - }) + self.chunk.inspect(|chunk| self.chunk = chunk.next()) } }