@@ -12,7 +12,7 @@ use crate::task::{Context, Poll};
1212///
1313/// [`successor`]: fn.successor.html
1414#[ derive( Debug ) ]
15- pub struct Successor < F , Fut , T >
15+ pub struct Successors < F , Fut , T >
1616where
1717 Fut : Future < Output = T > ,
1818{
2222 _marker : PhantomData < Fut > ,
2323}
2424
25- /// Creates a new stream where to produce each new element a clousre is called with the previous
25+ /// Creates a new stream where to produce each new element a closure is called with the previous
2626/// value.
2727///
2828/// #Examples
3333/// use async_std::prelude::*;
3434/// use async_std::stream;
3535///
36- /// let s = stream::successor (22, |val| {
36+ /// let s = stream::successors (22, |val| {
3737/// async move {
3838/// val + 1
3939/// }
@@ -47,21 +47,21 @@ where
4747/// # }) }
4848///
4949/// ```
50- pub fn successor < F , Fut , T > ( start : T , func : F ) -> Successor < F , Fut , T >
50+ pub fn successors < F , Fut , T > ( start : T , func : F ) -> Successors < F , Fut , T >
5151where
5252 F : FnMut ( T ) -> Fut ,
5353 Fut : Future < Output = T > ,
5454 T : Copy ,
5555{
56- Successor {
56+ Successors {
5757 successor : func,
5858 future : None ,
5959 next : start,
6060 _marker : PhantomData ,
6161 }
6262}
6363
64- impl < F , Fut , T > Successor < F , Fut , T >
64+ impl < F , Fut , T > Successors < F , Fut , T >
6565where
6666 F : FnMut ( T ) -> Fut ,
6767 Fut : Future < Output = T > ,
7272 pin_utils:: unsafe_pinned!( future: Option <Fut >) ;
7373}
7474
75- impl < F , Fut , T > Stream for Successor < F , Fut , T >
75+ impl < F , Fut , T > Stream for Successors < F , Fut , T >
7676where
7777 Fut : Future < Output = T > ,
7878 F : FnMut ( T ) -> Fut ,
0 commit comments