Fix TimeoutError

yoshuawuyts-patch-1
k-nasa 5 years ago
parent 7a87dea085
commit 10f32ca817

@ -35,7 +35,7 @@ impl<S: Stream> Stream for TimeoutStream<S> {
Poll::Ready(Some(v)) => Poll::Ready(Some(Ok(v))), Poll::Ready(Some(v)) => Poll::Ready(Some(Ok(v))),
Poll::Ready(None) => Poll::Ready(None), Poll::Ready(None) => Poll::Ready(None),
Poll::Pending => match self.delay().poll(cx) { Poll::Pending => match self.delay().poll(cx) {
Poll::Ready(_) => Poll::Ready(Some(Err(TimeoutError))), Poll::Ready(_) => Poll::Ready(Some(Err(TimeoutError { _private: () }))),
Poll::Pending => Poll::Pending, Poll::Pending => Poll::Pending,
}, },
} }
@ -46,7 +46,9 @@ impl<S: Stream> Stream for TimeoutStream<S> {
#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[cfg(any(feature = "unstable", feature = "docs"))] #[cfg(any(feature = "unstable", feature = "docs"))]
#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct TimeoutError; pub struct TimeoutError {
_private: (),
}
impl Error for TimeoutError {} impl Error for TimeoutError {}

Loading…
Cancel
Save