Skip to content

Commit b0038e1

Browse files
committed
Only implement the DoubleEndedStream for once when the flag is on
1 parent 8e5dede commit b0038e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/stream/once.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use pin_project_lite::pin_project;
44

55
use crate::stream::Stream;
66
use crate::task::{Context, Poll};
7-
use crate::stream::double_ended_stream::DoubleEndedStream;
7+
8+
#[cfg(feature = "unstable")]
9+
use crate::stream::DoubleEndedStream;
810

911
/// Creates a stream that yields a single item.
1012
///
@@ -48,6 +50,7 @@ impl<T> Stream for Once<T> {
4850
}
4951
}
5052

53+
#[cfg(feature = "unstable")]
5154
impl <T> DoubleEndedStream for Once<T> {
5255
fn poll_next_back(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
5356
Poll::Ready(self.project().value.take())

0 commit comments

Comments
 (0)