Skip to content

Commit d68dc65

Browse files
committed
remove pin_mut from successors test
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent b5c3fb8 commit d68dc65

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/stream/successors.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::pin::Pin;
21
use std::mem;
2+
use std::pin::Pin;
33

44
use crate::stream::Stream;
55
use 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)))]
3432
pub fn successors<F, T>(first: Option<T>, succ: F) -> Successors<F, T>
3533
where
3634
F: FnMut(&T) -> Option<T>,
3735
{
38-
Successors {
39-
succ,
40-
slot: first,
41-
}
36+
Successors { succ, slot: first }
4237
}
4338

4439
pin_project! {

0 commit comments

Comments
 (0)