Skip to content

Commit

Permalink
chore: Make Clippy happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Dec 4, 2024
1 parent 0b4895a commit 0376867
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Deref for ObservableItems {
/// An “iterator“ that yields entries into an `ObservableItems`.
pub struct ObservableItemsEntries<'a>(ObservableVectorEntries<'a, Arc<TimelineItem>>);

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<ObservableItemsEntry<'_>> {
Expand All @@ -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<TimelineItem>>);

impl<'a> ObservableItemsEntry<'a> {
impl ObservableItemsEntry<'_> {
/// Replace the timeline item by `timeline_item`.
pub fn replace(this: &mut Self, timeline_item: Arc<TimelineItem>) -> Arc<TimelineItem> {
ObservableVectorEntry::set(&mut this.0, timeline_item)
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -307,7 +307,7 @@ pub struct ObservableItemsTransactionEntry<'a, 'observable_items>(
ObservableVectorTransactionEntry<'a, 'observable_items, Arc<TimelineItem>>,
);

impl<'a, 'o> ObservableItemsTransactionEntry<'a, 'o> {
impl ObservableItemsTransactionEntry<'_, '_> {
/// Replace the timeline item by `timeline_item`.
pub fn replace(this: &mut Self, timeline_item: Arc<TimelineItem>) -> Arc<TimelineItem> {
ObservableVectorTransactionEntry::set(&mut this.0, timeline_item)
Expand Down
4 changes: 2 additions & 2 deletions crates/matrix-sdk-ui/src/timeline/controller/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-ui/src/timeline/read_receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

Expand Down

0 comments on commit 0376867

Please sign in to comment.