File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ pub struct Pending<T> {
1212
1313impl < T > FusedFuture for Pending < T > {
1414 fn is_terminated ( & self ) -> bool {
15- false
15+ true
1616 }
1717}
1818
Original file line number Diff line number Diff line change 11use core:: marker:: PhantomData ;
22use core:: pin:: Pin ;
3- use futures_core:: stream:: Stream ;
3+ use futures_core:: stream:: { FusedStream , Stream } ;
44use futures_core:: task:: { Context , Poll } ;
55
66/// Stream for the [`empty`] function.
@@ -21,6 +21,12 @@ pub fn empty<T>() -> Empty<T> {
2121
2222impl < T > Unpin for Empty < T > { }
2323
24+ impl < T > FusedStream for Empty < T > {
25+ fn is_terminated ( & self ) -> bool {
26+ true
27+ }
28+ }
29+
2430impl < T > Stream for Empty < T > {
2531 type Item = T ;
2632
Original file line number Diff line number Diff line change 11use core:: marker;
22use core:: pin:: Pin ;
3-
4- use futures_core:: { Stream , Poll } ;
5- use futures_core:: task;
3+ use futures_core:: stream:: { FusedStream , Stream } ;
4+ use futures_core:: task:: { Context , Poll } ;
65
76/// Stream for the [`pending()`] function.
87#[ derive( Debug ) ]
@@ -18,10 +17,16 @@ pub fn pending<T>() -> Pending<T> {
1817 Pending { _data : marker:: PhantomData }
1918}
2019
20+ impl < T > FusedStream for Pending < T > {
21+ fn is_terminated ( & self ) -> bool {
22+ true
23+ }
24+ }
25+
2126impl < T > Stream for Pending < T > {
2227 type Item = T ;
2328
24- fn poll_next ( self : Pin < & mut Self > , _: & mut task :: Context < ' _ > ) -> Poll < Option < Self :: Item > > {
29+ fn poll_next ( self : Pin < & mut Self > , _: & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
2530 Poll :: Pending
2631 }
2732}
You can’t perform that action at this time.
0 commit comments