@@ -5,7 +5,7 @@ use crate::future::Future;
5
5
use crate :: stream:: Stream ;
6
6
use crate :: task:: { Context , Poll } ;
7
7
8
- /// A stream that repeats elements of type `T` endlessly by applying a provided clousre .
8
+ /// A stream that repeats elements of type `T` endlessly by applying a provided closure .
9
9
///
10
10
/// This stream is constructed by the [`repeat_with`] function.
11
11
///
@@ -31,14 +31,12 @@ pub struct RepeatWith<F, Fut, A> {
31
31
///
32
32
/// let s = stream::repeat_with(|| async { 1 });
33
33
///
34
- ///
35
34
/// pin_utils::pin_mut!(s);
36
35
///
37
36
/// assert_eq!(s.next().await, Some(1));
38
37
/// assert_eq!(s.next().await, Some(1));
39
38
/// assert_eq!(s.next().await, Some(1));
40
39
/// assert_eq!(s.next().await, Some(1));
41
- ///
42
40
/// # }) }
43
41
/// ```
44
42
///
@@ -52,13 +50,11 @@ pub struct RepeatWith<F, Fut, A> {
52
50
///
53
51
/// let s = stream::repeat_with(|| async { 1u8 }).take(2);
54
52
///
55
- ///
56
53
/// pin_utils::pin_mut!(s);
57
54
///
58
55
/// assert_eq!(s.next().await, Some(1));
59
56
/// assert_eq!(s.next().await, Some(1));
60
57
/// assert_eq!(s.next().await, None);
61
- ///
62
58
/// # }) }
63
59
/// ```
64
60
pub fn repeat_with < F , Fut , A > ( repeater : F ) -> RepeatWith < F , Fut , A > {
0 commit comments