forked from mirror/async-std
Merge pull request #547 from async-rs/unpin-successors-test
remove pin_mut from successors test
This commit is contained in:
commit
355e2eded8
1 changed files with 3 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
use std::pin::Pin;
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
use std::pin::Pin;
|
||||||
|
|
||||||
use crate::stream::Stream;
|
use crate::stream::Stream;
|
||||||
use crate::task::{Context, Poll};
|
use crate::task::{Context, Poll};
|
||||||
|
@ -17,9 +17,8 @@ use pin_project_lite::pin_project;
|
||||||
/// use async_std::prelude::*;
|
/// use async_std::prelude::*;
|
||||||
/// use async_std::stream;
|
/// 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(22));
|
||||||
/// assert_eq!(s.next().await, Some(23));
|
/// assert_eq!(s.next().await, Some(23));
|
||||||
/// assert_eq!(s.next().await, Some(24));
|
/// assert_eq!(s.next().await, Some(24));
|
||||||
|
@ -27,7 +26,6 @@ use pin_project_lite::pin_project;
|
||||||
///
|
///
|
||||||
/// #
|
/// #
|
||||||
/// # }) }
|
/// # }) }
|
||||||
///
|
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "unstable")]
|
#[cfg(feature = "unstable")]
|
||||||
#[cfg_attr(feature = "docs", doc(cfg(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
|
where
|
||||||
F: FnMut(&T) -> Option<T>,
|
F: FnMut(&T) -> Option<T>,
|
||||||
{
|
{
|
||||||
Successors {
|
Successors { succ, slot: first }
|
||||||
succ,
|
|
||||||
slot: first,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pin_project! {
|
pin_project! {
|
||||||
|
|
Loading…
Reference in a new issue