use std::collections::BinaryHeap; use std::pin::Pin; use crate::prelude::*; use crate::stream::{Extend, IntoStream}; impl Extend for BinaryHeap { fn stream_extend<'a, S: IntoStream + 'a>( &'a mut self, stream: S, ) -> Pin + 'a>> { let stream = stream.into_stream(); //TODO: Add this back in when size_hint is added to Stream/StreamExt //let (lower_bound, _) = stream.size_hint(); //self.reserve(lower_bound); Box::pin(stream.for_each(move |item| self.push(item))) } }