Skip to content

Commit c3f6f96

Browse files
committed
fix: Rename TimeoutStream to Timeout
1 parent 10f32ca commit c3f6f96

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/stream/stream/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ cfg_if! {
113113
use crate::stream::FromStream;
114114

115115
pub use merge::Merge;
116-
pub use timeout::TimeoutStream;
116+
pub use timeout::Timeout;
117117
}
118118
}
119119

@@ -1074,11 +1074,11 @@ extension_trait! {
10741074
"#]
10751075
#[cfg(any(feature = "unstable", feature = "docs"))]
10761076
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1077-
fn timeout(self, dur: Duration) -> TimeoutStream<Self>
1077+
fn timeout(self, dur: Duration) -> Timeout<Self>
10781078
where
10791079
Self: Stream + Sized,
10801080
{
1081-
TimeoutStream::new(self, dur)
1081+
Timeout::new(self, dur)
10821082
}
10831083

10841084
#[doc = r#"

src/stream/stream/timeout.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ use crate::task::{Context, Poll};
1111

1212
#[doc(hidden)]
1313
#[derive(Debug)]
14-
pub struct TimeoutStream<S> {
14+
pub struct Timeout<S: Stream> {
1515
stream: S,
1616
delay: Delay,
1717
}
1818

19-
impl<S> TimeoutStream<S> {
19+
impl<S: Stream> Timeout<S> {
2020
pin_utils::unsafe_pinned!(stream: S);
2121
pin_utils::unsafe_pinned!(delay: Delay);
2222

23-
pub fn new(stream: S, dur: Duration) -> TimeoutStream<S> {
23+
pub fn new(stream: S, dur: Duration) -> Timeout<S> {
2424
let delay = Delay::new(dur);
2525

26-
TimeoutStream { stream, delay }
26+
Timeout { stream, delay }
2727
}
2828
}
2929

30-
impl<S: Stream> Stream for TimeoutStream<S> {
30+
impl<S: Stream> Stream for Timeout<S> {
3131
type Item = Result<S::Item, TimeoutError>;
3232

3333
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {

0 commit comments

Comments
 (0)