From 05969fefdeadba5ae8135ccb8981ab9fafd38fb9 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 4 Dec 2024 19:43:54 +0100 Subject: [PATCH] chore: Make Clippy happy. --- .../src/timeline/controller/observable_items.rs | 8 ++++---- crates/matrix-sdk-ui/src/timeline/controller/state.rs | 4 ++-- crates/matrix-sdk-ui/src/timeline/read_receipts.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/matrix-sdk-ui/src/timeline/controller/observable_items.rs b/crates/matrix-sdk-ui/src/timeline/controller/observable_items.rs index a78106f83..6f258edf5 100644 --- a/crates/matrix-sdk-ui/src/timeline/controller/observable_items.rs +++ b/crates/matrix-sdk-ui/src/timeline/controller/observable_items.rs @@ -130,7 +130,7 @@ impl Deref for ObservableItems { /// An “iterator“ that yields entries into an `ObservableItems`. pub struct ObservableItemsEntries<'a>(ObservableVectorEntries<'a, Arc>); -impl<'a> ObservableItemsEntries<'a> { +impl ObservableItemsEntries<'_> { /// Advance this iterator, yielding an `ObservableItemsEntry` for the next /// item in the timeline, or `None` if all items have been visited. pub fn next(&mut self) -> Option> { @@ -141,7 +141,7 @@ impl<'a> ObservableItemsEntries<'a> { /// A handle to a single timeline item in an `ObservableItems`. pub struct ObservableItemsEntry<'a>(ObservableVectorEntry<'a, Arc>); -impl<'a> ObservableItemsEntry<'a> { +impl ObservableItemsEntry<'_> { /// Replace the timeline item by `timeline_item`. pub fn replace(this: &mut Self, timeline_item: Arc) -> Arc { ObservableVectorEntry::set(&mut this.0, timeline_item) @@ -176,7 +176,7 @@ impl<'observable_items> ObservableItemsTransaction<'observable_items> { /// Get a reference to all remote events. pub fn all_remote_events(&self) -> &AllRemoteEvents { - &self.all_remote_events + self.all_remote_events } /// Remove a remote event at position `event_index`. @@ -307,7 +307,7 @@ pub struct ObservableItemsTransactionEntry<'a, 'observable_items>( ObservableVectorTransactionEntry<'a, 'observable_items, Arc>, ); -impl<'a, 'o> ObservableItemsTransactionEntry<'a, 'o> { +impl ObservableItemsTransactionEntry<'_, '_> { /// Replace the timeline item by `timeline_item`. pub fn replace(this: &mut Self, timeline_item: Arc) -> Arc { ObservableVectorTransactionEntry::set(&mut this.0, timeline_item) diff --git a/crates/matrix-sdk-ui/src/timeline/controller/state.rs b/crates/matrix-sdk-ui/src/timeline/controller/state.rs index 9df9ffb8e..520f3ac82 100644 --- a/crates/matrix-sdk-ui/src/timeline/controller/state.rs +++ b/crates/matrix-sdk-ui/src/timeline/controller/state.rs @@ -731,7 +731,7 @@ impl TimelineStateTransaction<'_> { match position { TimelineItemPosition::Start { .. } => { if let Some(pos) = - event_already_exists(event_meta.event_id, &self.items.all_remote_events()) + event_already_exists(event_meta.event_id, self.items.all_remote_events()) { self.items.remove_remote_event(pos); } @@ -741,7 +741,7 @@ impl TimelineStateTransaction<'_> { TimelineItemPosition::End { .. } => { if let Some(pos) = - event_already_exists(event_meta.event_id, &self.items.all_remote_events()) + event_already_exists(event_meta.event_id, self.items.all_remote_events()) { self.items.remove_remote_event(pos); } diff --git a/crates/matrix-sdk-ui/src/timeline/read_receipts.rs b/crates/matrix-sdk-ui/src/timeline/read_receipts.rs index 30226de15..00964de20 100644 --- a/crates/matrix-sdk-ui/src/timeline/read_receipts.rs +++ b/crates/matrix-sdk-ui/src/timeline/read_receipts.rs @@ -485,7 +485,7 @@ impl TimelineStateTransaction<'_> { let read_receipts = self.meta.read_receipts.compute_event_receipts( &remote_prev_event_item.event_id, - &self.items.all_remote_events(), + self.items.all_remote_events(), false, );