Skip to content

Commit e7ee239

Browse files
committed
refactor(ui): Rename TimelineStream to WithTimelineDropHandle.
This patch renames `TimelineStream` to `WithTimelineDropHandle`, as the former name was too vague and was not clarify what the type was doing. The new name makes it clear that it attaches a `TimelineDropHandle` to a subscriber (since it is part of the `subscriber` module!).
1 parent 2ab9b05 commit e7ee239

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use ruma::{
5252
serde::Raw,
5353
EventId, MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedUserId, RoomVersionId, UserId,
5454
};
55-
use subscriber::TimelineStream;
55+
use subscriber::WithTimelineDropHandle;
5656
use thiserror::Error;
5757
use tracing::{error, instrument, trace, warn};
5858

@@ -277,7 +277,7 @@ impl Timeline {
277277
&self,
278278
) -> (Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>>) {
279279
let (items, stream) = self.controller.subscribe_batched().await;
280-
let stream = TimelineStream::new(stream, self.drop_handle.clone());
280+
let stream = WithTimelineDropHandle::new(stream, self.drop_handle.clone());
281281
(items, stream)
282282
}
283283

@@ -811,7 +811,7 @@ impl Timeline {
811811
f: impl Fn(Arc<TimelineItem>) -> Option<U>,
812812
) -> (Vector<U>, impl Stream<Item = VectorDiff<U>>) {
813813
let (items, stream) = self.controller.subscribe_filter_map(f).await;
814-
let stream = TimelineStream::new(stream, self.drop_handle.clone());
814+
let stream = WithTimelineDropHandle::new(stream, self.drop_handle.clone());
815815
(items, stream)
816816
}
817817
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ use pin_project_lite::pin_project;
2424
use super::TimelineDropHandle;
2525

2626
pin_project! {
27-
pub(super) struct TimelineStream<S> {
27+
pub(super) struct WithTimelineDropHandle<S> {
2828
#[pin]
2929
inner: S,
3030
drop_handle: Arc<TimelineDropHandle>,
3131
}
3232
}
3333

34-
impl<S> TimelineStream<S> {
34+
impl<S> WithTimelineDropHandle<S> {
3535
pub fn new(inner: S, drop_handle: Arc<TimelineDropHandle>) -> Self {
3636
Self { inner, drop_handle }
3737
}
3838
}
3939

40-
impl<S> Stream for TimelineStream<S>
40+
impl<S> Stream for WithTimelineDropHandle<S>
4141
where
4242
S: Stream,
4343
{

0 commit comments

Comments
 (0)