From 400f718ec0fab11dc47dd95aca02636da3262e4e Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 29 Jun 2026 15:00:03 +0200 Subject: [PATCH] chore(sdk): Simplifying code a little bit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch simplifies a `îf let Some(x) = y && x == z` to `y == Some(z)`. This patch also uses relative imports instead of absolutely imports. --- crates/matrix-sdk/src/event_cache/caches/read_receipts.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/matrix-sdk/src/event_cache/caches/read_receipts.rs b/crates/matrix-sdk/src/event_cache/caches/read_receipts.rs index ff962626c..b458aa81a 100644 --- a/crates/matrix-sdk/src/event_cache/caches/read_receipts.rs +++ b/crates/matrix-sdk/src/event_cache/caches/read_receipts.rs @@ -119,8 +119,8 @@ use ruma::{ }; use tracing::{debug, instrument, trace, warn}; -use crate::event_cache::{ - automatic_pagination::AutomaticPagination, caches::event_linked_chunk::EventLinkedChunk, +use super::{ + super::automatic_pagination::AutomaticPagination, event_linked_chunk::EventLinkedChunk, }; trait RoomReadReceiptsExt { @@ -210,9 +210,7 @@ impl RoomReadReceiptsExt for RoomReadReceipts { // Sliding sync sometimes sends the same event multiple times, so it can be at // the beginning and end of a batch, for instance. In that case, just reset // every time we see the event matching the receipt. - if let Some(event_id) = event.event_id() - && event_id == receipt_event_id - { + if event.event_id() == Some(receipt_event_id) { // Bingo! Switch over to the counting state, after resetting the // previous counts. trace!("Found the event the receipt was referring to! Starting to count.");