@@ -12,7 +12,7 @@ use crate::task::{Context, Poll};
12
12
///
13
13
/// [`successor`]: fn.successor.html
14
14
#[ derive( Debug ) ]
15
- pub struct Successor < F , Fut , T >
15
+ pub struct Successors < F , Fut , T >
16
16
where
17
17
Fut : Future < Output = T > ,
18
18
{
22
22
_marker : PhantomData < Fut > ,
23
23
}
24
24
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
26
26
/// value.
27
27
///
28
28
/// #Examples
33
33
/// use async_std::prelude::*;
34
34
/// use async_std::stream;
35
35
///
36
- /// let s = stream::successor (22, |val| {
36
+ /// let s = stream::successors (22, |val| {
37
37
/// async move {
38
38
/// val + 1
39
39
/// }
@@ -47,21 +47,21 @@ where
47
47
/// # }) }
48
48
///
49
49
/// ```
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 >
51
51
where
52
52
F : FnMut ( T ) -> Fut ,
53
53
Fut : Future < Output = T > ,
54
54
T : Copy ,
55
55
{
56
- Successor {
56
+ Successors {
57
57
successor : func,
58
58
future : None ,
59
59
next : start,
60
60
_marker : PhantomData ,
61
61
}
62
62
}
63
63
64
- impl < F , Fut , T > Successor < F , Fut , T >
64
+ impl < F , Fut , T > Successors < F , Fut , T >
65
65
where
66
66
F : FnMut ( T ) -> Fut ,
67
67
Fut : Future < Output = T > ,
72
72
pin_utils:: unsafe_pinned!( future: Option <Fut >) ;
73
73
}
74
74
75
- impl < F , Fut , T > Stream for Successor < F , Fut , T >
75
+ impl < F , Fut , T > Stream for Successors < F , Fut , T >
76
76
where
77
77
Fut : Future < Output = T > ,
78
78
F : FnMut ( T ) -> Fut ,
0 commit comments