From ebbf34e924a2d4c21849ef97ae7773b2a330ee9f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 25 Dec 2025 22:33:33 +0100 Subject: [PATCH] Fix more new clippy lints --- .../src/event_cache_store/mod.rs | 12 +++++------- crates/matrix-sdk-indexeddb/src/media_store/mod.rs | 12 ++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs index 69014d906..efa87d9f0 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs @@ -406,15 +406,13 @@ impl EventCacheStore for IndexeddbEventCacheStore { )?; if let Some(chunk) = transaction.get_chunk_by_id(linked_chunk_id, before_chunk_identifier).await? + && let Some(previous_identifier) = chunk.previous { - if let Some(previous_identifier) = chunk.previous { - let previous_identifier = ChunkIdentifier::new(previous_identifier); - return Ok(transaction - .load_chunk_by_id(linked_chunk_id, previous_identifier) - .await?); - } + let previous_identifier = ChunkIdentifier::new(previous_identifier); + Ok(transaction.load_chunk_by_id(linked_chunk_id, previous_identifier).await?) + } else { + Ok(None) } - Ok(None) } #[instrument(skip(self))] diff --git a/crates/matrix-sdk-indexeddb/src/media_store/mod.rs b/crates/matrix-sdk-indexeddb/src/media_store/mod.rs index 67d568ea8..c9d51a597 100644 --- a/crates/matrix-sdk-indexeddb/src/media_store/mod.rs +++ b/crates/matrix-sdk-indexeddb/src/media_store/mod.rs @@ -345,12 +345,12 @@ impl MediaStoreInner for IndexeddbMediaStore { let transaction = self.transaction(&[MediaMetadata::OBJECT_STORE], TransactionMode::Readwrite)?; - if let Some(mut metadata) = transaction.get_media_metadata_by_id(request).await? { - if metadata.ignore_policy != ignore_policy { - metadata.ignore_policy = ignore_policy; - transaction.put_media_metadata(&metadata).await?; - transaction.commit().await?; - } + if let Some(mut metadata) = transaction.get_media_metadata_by_id(request).await? + && metadata.ignore_policy != ignore_policy + { + metadata.ignore_policy = ignore_policy; + transaction.put_media_metadata(&metadata).await?; + transaction.commit().await?; } Ok(()) }