forked from mirror/async-std
Only implement the DoubleEndedStream for once when the flag is on
This commit is contained in:
parent
8e5dedec34
commit
b0038e11be
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,9 @@ use pin_project_lite::pin_project;
|
|||
|
||||
use crate::stream::Stream;
|
||||
use crate::task::{Context, Poll};
|
||||
use crate::stream::double_ended_stream::DoubleEndedStream;
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
use crate::stream::DoubleEndedStream;
|
||||
|
||||
/// Creates a stream that yields a single item.
|
||||
///
|
||||
|
@ -48,6 +50,7 @@ impl<T> Stream for Once<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
impl <T> DoubleEndedStream for Once<T> {
|
||||
fn poll_next_back(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
Poll::Ready(self.project().value.take())
|
||||
|
|
Loading…
Reference in a new issue