Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Stream implementation from VecDeque #1930

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions futures-core/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,6 @@ mod if_alloc {
}
}

impl<T: Unpin> Stream for alloc::collections::VecDeque<T> {
type Item = T;

fn poll_next(
mut self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Option<Self::Item>> {
Poll::Ready(self.pop_front())
}

fn size_hint(&self) -> (usize, Option<usize>) {
let len = self.len();
(len, Some(len))
}
}

#[cfg(feature = "std")]
impl<S: Stream> Stream for std::panic::AssertUnwindSafe<S> {
type Item = S::Item;
Expand Down
5 changes: 2 additions & 3 deletions futures-util/src/sink/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,12 @@ pub trait SinkExt<Item>: Sink<Item> {
/// # futures::executor::block_on(async {
/// use futures::channel::mpsc;
/// use futures::sink::SinkExt;
/// use futures::stream::StreamExt;
/// use std::collections::VecDeque;
/// use futures::stream::{self, StreamExt};
///
/// let (tx, rx) = mpsc::channel(5);
///
/// let mut tx = tx.with_flat_map(|x| {
/// VecDeque::from(vec![Ok(42); x])
/// stream::iter(vec![Ok(42); x])
/// });
///
/// tx.send(5).await.unwrap();
Expand Down