File tree 3 files changed +17
-6
lines changed 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> {
12
12
13
13
impl < T > FusedFuture for Pending < T > {
14
14
fn is_terminated ( & self ) -> bool {
15
- false
15
+ true
16
16
}
17
17
}
18
18
Original file line number Diff line number Diff line change 1
1
use core:: marker:: PhantomData ;
2
2
use core:: pin:: Pin ;
3
- use futures_core:: stream:: Stream ;
3
+ use futures_core:: stream:: { FusedStream , Stream } ;
4
4
use futures_core:: task:: { Context , Poll } ;
5
5
6
6
/// Stream for the [`empty`] function.
@@ -21,6 +21,12 @@ pub fn empty<T>() -> Empty<T> {
21
21
22
22
impl < T > Unpin for Empty < T > { }
23
23
24
+ impl < T > FusedStream for Empty < T > {
25
+ fn is_terminated ( & self ) -> bool {
26
+ true
27
+ }
28
+ }
29
+
24
30
impl < T > Stream for Empty < T > {
25
31
type Item = T ;
26
32
Original file line number Diff line number Diff line change 1
1
use core:: marker;
2
2
use 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 } ;
6
5
7
6
/// Stream for the [`pending()`] function.
8
7
#[ derive( Debug ) ]
@@ -18,10 +17,16 @@ pub fn pending<T>() -> Pending<T> {
18
17
Pending { _data : marker:: PhantomData }
19
18
}
20
19
20
+ impl < T > FusedStream for Pending < T > {
21
+ fn is_terminated ( & self ) -> bool {
22
+ true
23
+ }
24
+ }
25
+
21
26
impl < T > Stream for Pending < T > {
22
27
type Item = T ;
23
28
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 > > {
25
30
Poll :: Pending
26
31
}
27
32
}
You can’t perform that action at this time.
0 commit comments