@@ -7,33 +7,10 @@ use crate::task::{Context, Poll, ready};
77
88use pin_project_lite:: pin_project;
99
10-
11-
12- pin_project ! {
13- /// A stream that yields elements by calling an async closure with the previous value as an
14- /// argument
15- ///
16- /// This stream is constructed by [`successors`] function
17- ///
18- /// [`succcessors`]: fn.succssors.html
19- #[ cfg( feature = "unstable" ) ]
20- #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
21- #[ derive( Debug ) ]
22- pub struct Successors <F , Fut , T >
23- where
24- Fut : Future <Output = Option <T >>,
25- {
26- succ: F ,
27- #[ pin]
28- future: Option <Fut >,
29- slot: Option <T >,
30- }
31- }
32-
3310/// Creates a new stream where to produce each new element a closure is called with the previous
3411/// value.
3512///
36- /// #Examples
13+ /// # Examples
3714///
3815/// ```
3916/// # fn main() { async_std::task::block_on(async {
8259 }
8360}
8461
62+ pin_project ! {
63+ /// A stream that yields elements by calling an async closure with the previous value as an
64+ /// argument
65+ ///
66+ /// This stream is constructed by [`successors`] function
67+ ///
68+ /// [`successors`]: fn.succssors.html
69+ #[ cfg( feature = "unstable" ) ]
70+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
71+ #[ derive( Debug ) ]
72+ pub struct Successors <F , Fut , T >
73+ where
74+ Fut : Future <Output = Option <T >>,
75+ {
76+ succ: F ,
77+ #[ pin]
78+ future: Option <Fut >,
79+ slot: Option <T >,
80+ }
81+ }
82+
8583impl < F , Fut , T > Stream for Successors < F , Fut , T >
8684where
8785 Fut : Future < Output = Option < T > > ,
0 commit comments