Skip to content

Commit a2a2c6c

Browse files
committed
chore(ui): Upgrade to Rust edition 2024
1 parent cd03a58 commit a2a2c6c

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

crates/matrix-sdk-ui/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "matrix-sdk-ui"
33
description = "GUI-centric utilities on top of matrix-rust-sdk (experimental)."
44
version = "0.12.0"
5-
edition = "2021"
5+
edition = "2024"
66
repository = "https://github.com/matrix-org/matrix-rust-sdk"
77
license = "Apache-2.0"
88
rust-version.workspace = true

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
@@ -315,7 +315,7 @@ impl RoomListService {
315315
&self,
316316
delay_before_showing: Duration,
317317
delay_before_hiding: Duration,
318-
) -> impl Stream<Item = SyncIndicator> {
318+
) -> impl Stream<Item = SyncIndicator> + use<> {
319319
let mut state = self.state();
320320

321321
stream! {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ impl<P: RoomDataProvider, D: Decryptor> TimelineController<P, D> {
586586
&self,
587587
) -> (
588588
Vector<Arc<TimelineItem>>,
589-
impl Stream<Item = VectorDiff<Arc<TimelineItem>>> + SendOutsideWasm,
589+
impl Stream<Item = VectorDiff<Arc<TimelineItem>>> + SendOutsideWasm + use<P, D>,
590590
) {
591591
let state = self.state.read().await;
592592

@@ -602,7 +602,7 @@ impl<P: RoomDataProvider, D: Decryptor> TimelineController<P, D> {
602602
pub(super) async fn subscribe_filter_map<U, F>(
603603
&self,
604604
f: F,
605-
) -> (Vector<U>, impl Stream<Item = VectorDiff<U>>)
605+
) -> (Vector<U>, impl Stream<Item = VectorDiff<U>> + use<U, F, P, D>)
606606
where
607607
U: Clone,
608608
F: Fn(Arc<TimelineItem>) -> Option<U>,
@@ -1222,7 +1222,9 @@ impl<P: RoomDataProvider, D: Decryptor> TimelineController<P, D> {
12221222
}
12231223

12241224
/// Subscribe to changes in the read receipts of our own user.
1225-
pub async fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> {
1225+
pub async fn subscribe_own_user_read_receipts_changed(
1226+
&self,
1227+
) -> impl Stream<Item = ()> + use<P, D> {
12261228
self.state.read().await.meta.read_receipts.subscribe_own_user_read_receipts_changed()
12271229
}
12281230

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ 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(&self) -> impl Stream<Item = ()> + use<> {
6060
let subscriber = self.own_user_read_receipts_changed_sender.subscribe();
6161
WatchStream::from_changes(subscriber)
6262
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl Timeline {
255255
/// and batches them.
256256
pub async fn subscribe(
257257
&self,
258-
) -> (Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>>) {
258+
) -> (Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>> + use<>) {
259259
let (items, stream) = self.controller.subscribe().await;
260260
let stream = TimelineWithDropHandle::new(stream, self.drop_handle.clone());
261261
(items, stream)
@@ -564,7 +564,7 @@ impl Timeline {
564564
}
565565

566566
/// Subscribe to changes in the read receipts of our own user.
567-
pub async fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> {
567+
pub async fn subscribe_own_user_read_receipts_changed(&self) -> impl Stream<Item = ()> + use<> {
568568
self.controller.subscribe_own_user_read_receipts_changed().await
569569
}
570570

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

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

0 commit comments

Comments
 (0)