Skip to content

Commit b32bf86

Browse files
Implement Stream for Empty
Closes rust-lang#113
1 parent 8677afc commit b32bf86

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/empty.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use core::marker;
22

33
use {Future, Poll};
4+
use stream::Stream;
45

56
/// A future which is never resolved.
67
///
@@ -27,3 +28,15 @@ impl<T, E> Future for Empty<T, E> {
2728
Poll::NotReady
2829
}
2930
}
31+
32+
impl<T, E> Stream for Empty<T, E>
33+
where T: Send + 'static,
34+
E: Send + 'static
35+
{
36+
type Item = T;
37+
type Error = E;
38+
39+
fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
40+
Poll::Ok(None)
41+
}
42+
}

0 commit comments

Comments
 (0)