Skip to content

Commit 0c66d8a

Browse files
committed
refactor(ui): Cherry-pick some edition-fix changes
Automated with `cargo fix --edition -p matrix-sdk-ui`, reverting unnecessary changes.
1 parent 25ed7ee commit 0c66d8a

File tree

8 files changed

+14
-9
lines changed

8 files changed

+14
-9
lines changed

crates/matrix-sdk-ui/src/room_list_service/filters/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use super::{BoxedFilterFn, Filter};
1616

1717
/// Create a new filter that will run multiple filters. It returns `true` if at
1818
/// least one of the filter returns `true`.
19-
pub fn new_filter(filters: Vec<BoxedFilterFn>) -> impl Filter {
19+
pub fn new_filter(filters: Vec<BoxedFilterFn>) -> impl Filter + use<> {
2020
move |room| -> bool { filters.iter().any(|filter| filter(room)) }
2121
}
2222

crates/matrix-sdk-ui/src/room_list_service/filters/fuzzy_match_room_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl FuzzyMatcher {
4444
///
4545
/// Rooms are fetched from the `Client`. The pattern and the room names are
4646
/// normalized with `normalize_string`.
47-
pub fn new_filter(pattern: &str) -> impl Filter {
47+
pub fn new_filter(pattern: &str) -> impl Filter + use<> {
4848
let searcher = FuzzyMatcher::new().with_pattern(pattern);
4949

5050
move |room| -> bool {

crates/matrix-sdk-ui/src/room_list_service/filters/normalized_match_room_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl NormalizedMatcher {
4545
///
4646
/// Rooms are fetched from the `Client`. The pattern and the room names are
4747
/// normalized with `normalize_string`.
48-
pub fn new_filter(pattern: &str) -> impl Filter {
48+
pub fn new_filter(pattern: &str) -> impl Filter + use<> {
4949
let searcher = NormalizedMatcher::new().with_pattern(pattern);
5050

5151
move |room| -> bool {

crates/matrix-sdk-ui/src/room_list_service/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl RoomListService {
326326
&self,
327327
delay_before_showing: Duration,
328328
delay_before_hiding: Duration,
329-
) -> impl Stream<Item = SyncIndicator> {
329+
) -> impl Stream<Item = SyncIndicator> + use<> {
330330
let mut state = self.state();
331331

332332
stream! {

crates/matrix-sdk-ui/src/timeline/controller/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,9 @@ impl<P: RoomDataProvider, D: Decryptor> TimelineController<P, D> {
12401240
}
12411241

12421242
/// Subscribe to changes in the read receipts of our own user.
1243-
pub async fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> {
1243+
pub async fn subscribe_own_user_read_receipts_changed(
1244+
&self,
1245+
) -> impl Stream<Item = ()> + use<P, D> {
12441246
self.state.read().await.meta.read_receipts.subscribe_own_user_read_receipts_changed()
12451247
}
12461248

crates/matrix-sdk-ui/src/timeline/controller/read_receipts.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ impl ReadReceipts {
5656
}
5757

5858
/// Subscribe to changes in the read receipts of our own user.
59-
pub(super) fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> {
59+
pub(super) fn subscribe_own_user_read_receipts_changed(
60+
&self,
61+
) -> impl Stream<Item = ()> + use<> {
6062
let subscriber = self.own_user_read_receipts_changed_sender.subscribe();
6163
WatchStream::from_changes(subscriber)
6264
}

crates/matrix-sdk-ui/src/timeline/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ impl Timeline {
251251
/// and batches them.
252252
pub async fn subscribe(
253253
&self,
254-
) -> (Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>>) {
254+
) -> (Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>> + use<>)
255+
{
255256
let (items, stream) = self.controller.subscribe().await;
256257
let stream = TimelineWithDropHandle::new(stream, self.drop_handle.clone());
257258
(items, stream)
@@ -560,7 +561,7 @@ impl Timeline {
560561
}
561562

562563
/// Subscribe to changes in the read receipts of our own user.
563-
pub async fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> {
564+
pub async fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> + use<> {
564565
self.controller.subscribe_own_user_read_receipts_changed().await
565566
}
566567

crates/matrix-sdk-ui/src/timeline/pagination.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl super::Timeline {
107107
/// call to [`Self::paginate_backwards()`].
108108
pub async fn live_back_pagination_status(
109109
&self,
110-
) -> Option<(RoomPaginationStatus, impl Stream<Item = RoomPaginationStatus>)> {
110+
) -> Option<(RoomPaginationStatus, impl Stream<Item = RoomPaginationStatus> + use<>)> {
111111
if !self.controller.is_live() {
112112
return None;
113113
}

0 commit comments

Comments
 (0)