File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1- use std:: pin:: Pin ;
21use std:: mem;
2+ use std:: pin:: Pin ;
33
44use crate :: stream:: Stream ;
55use crate :: task:: { Context , Poll } ;
@@ -17,28 +17,23 @@ use pin_project_lite::pin_project;
1717/// use async_std::prelude::*;
1818/// use async_std::stream;
1919///
20- /// let s = stream::successors(Some(22), |&val| Some(val + 1) );
20+ /// let mut s = stream::successors(Some(22), |&val| Some(val + 1));
2121///
22- /// pin_utils::pin_mut!(s);
2322/// assert_eq!(s.next().await, Some(22));
2423/// assert_eq!(s.next().await, Some(23));
2524/// assert_eq!(s.next().await, Some(24));
2625/// assert_eq!(s.next().await, Some(25));
2726///
2827/// #
2928/// # }) }
30- ///
3129/// ```
3230#[ cfg( feature = "unstable" ) ]
3331#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
3432pub fn successors < F , T > ( first : Option < T > , succ : F ) -> Successors < F , T >
3533where
3634 F : FnMut ( & T ) -> Option < T > ,
3735{
38- Successors {
39- succ,
40- slot : first,
41- }
36+ Successors { succ, slot : first }
4237}
4338
4439pin_project ! {
You can’t perform that action at this time.
0 commit comments