From b0038e11bed6d75f87b2c17a82da56b8534c98ce Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Thu, 28 Nov 2019 21:52:48 +0100 Subject: [PATCH] Only implement the DoubleEndedStream for once when the flag is on --- src/stream/once.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stream/once.rs b/src/stream/once.rs index 9ce93aa..939722d 100644 --- a/src/stream/once.rs +++ b/src/stream/once.rs @@ -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 Stream for Once { } } +#[cfg(feature = "unstable")] impl DoubleEndedStream for Once { fn poll_next_back(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(self.project().value.take())