Skip to content

Commit

Permalink
Remove Stream implementation from VecDeque
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 31, 2019
1 parent 0904be2 commit de860d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
16 changes: 0 additions & 16 deletions futures-core/src/stream.rs
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
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

0 comments on commit de860d8

Please sign in to comment.