File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,9 @@ where Fut: Future<Output=T>
3939/// });
4040///
4141/// pin_utils::pin_mut!(s);
42- /// assert_eq!(s.next().await, Some(1 ));
43- /// assert_eq!(s.next().await, Some(2 ));
44- /// assert_eq!(s.next().await, Some(3 ));
42+ /// assert_eq!(s.next().await, Some(23 ));
43+ /// assert_eq!(s.next().await, Some(24 ));
44+ /// assert_eq!(s.next().await, Some(25 ));
4545/// #
4646/// # }) }
4747///
@@ -83,20 +83,18 @@ where
8383
8484 fn poll_next ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
8585 match & self . future {
86- Some ( _) => {
87- let next = futures_core:: ready!( self . as_mut( ) . future( ) . as_pin_mut( ) . unwrap( ) . poll( cx) ) ;
88- self . as_mut ( ) . future ( ) . set ( None ) ;
89-
90- Poll :: Ready ( Some ( next) )
91- } ,
9286 None => {
9387 let x = self . next ;
9488 let fut = ( self . as_mut ( ) . successor ( ) ) ( x) ;
9589 self . as_mut ( ) . future ( ) . set ( Some ( fut) ) ;
96- // Probably can poll the value here?
97- Poll :: Pending
9890 }
91+ _ => { } ,
9992 }
93+
94+ let next = futures_core:: ready!( self . as_mut( ) . future( ) . as_pin_mut( ) . unwrap( ) . poll( cx) ) ;
95+ * self . as_mut ( ) . next ( ) = next;
96+ self . as_mut ( ) . future ( ) . set ( None ) ;
97+ Poll :: Ready ( Some ( next) )
10098 }
10199}
102100
You can’t perform that action at this time.
0 commit comments