File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
- use std:: pin:: Pin ;
2
1
use std:: mem;
2
+ use std:: pin:: Pin ;
3
3
4
4
use crate :: stream:: Stream ;
5
5
use crate :: task:: { Context , Poll } ;
@@ -17,28 +17,23 @@ use pin_project_lite::pin_project;
17
17
/// use async_std::prelude::*;
18
18
/// use async_std::stream;
19
19
///
20
- /// let s = stream::successors(Some(22), |&val| Some(val + 1) );
20
+ /// let mut s = stream::successors(Some(22), |&val| Some(val + 1));
21
21
///
22
- /// pin_utils::pin_mut!(s);
23
22
/// assert_eq!(s.next().await, Some(22));
24
23
/// assert_eq!(s.next().await, Some(23));
25
24
/// assert_eq!(s.next().await, Some(24));
26
25
/// assert_eq!(s.next().await, Some(25));
27
26
///
28
27
/// #
29
28
/// # }) }
30
- ///
31
29
/// ```
32
30
#[ cfg( feature = "unstable" ) ]
33
31
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
34
32
pub fn successors < F , T > ( first : Option < T > , succ : F ) -> Successors < F , T >
35
33
where
36
34
F : FnMut ( & T ) -> Option < T > ,
37
35
{
38
- Successors {
39
- succ,
40
- slot : first,
41
- }
36
+ Successors { succ, slot : first }
42
37
}
43
38
44
39
pin_project ! {
You can’t perform that action at this time.
0 commit comments