remove pin_mut from successors test

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
new-scheduler
Yoshua Wuyts 5 years ago
parent b5c3fb8bb5
commit d68dc659b2
No known key found for this signature in database
GPG Key ID: 24EA8164F96777ED

@ -1,5 +1,5 @@
use std::pin::Pin;
use std::mem;
use std::pin::Pin;
use crate::stream::Stream;
use crate::task::{Context, Poll};
@ -17,9 +17,8 @@ use pin_project_lite::pin_project;
/// use async_std::prelude::*;
/// use async_std::stream;
///
/// let s = stream::successors(Some(22), |&val| Some(val + 1) );
/// let mut s = stream::successors(Some(22), |&val| Some(val + 1));
///
/// pin_utils::pin_mut!(s);
/// assert_eq!(s.next().await, Some(22));
/// assert_eq!(s.next().await, Some(23));
/// assert_eq!(s.next().await, Some(24));
@ -27,7 +26,6 @@ use pin_project_lite::pin_project;
///
/// #
/// # }) }
///
/// ```
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
@ -35,10 +33,7 @@ pub fn successors<F, T>(first: Option<T>, succ: F) -> Successors<F, T>
where
F: FnMut(&T) -> Option<T>,
{
Successors {
succ,
slot: first,
}
Successors { succ, slot: first }
}
pin_project! {

Loading…
Cancel
Save