make priorityqueue's from_iter use heapify
This commit is contained in:
parent
dc65307e3b
commit
b8dc103a95
@ -527,10 +527,9 @@ fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
|
||||
}
|
||||
|
||||
impl<T: Ord> FromIterator<T> for PriorityQueue<T> {
|
||||
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> PriorityQueue<T> {
|
||||
let mut q = PriorityQueue::new();
|
||||
q.extend(iter);
|
||||
q
|
||||
fn from_iter<Iter: Iterator<T>>(mut iter: Iter) -> PriorityQueue<T> {
|
||||
let vec: Vec<T> = iter.collect();
|
||||
PriorityQueue::from_vec(vec)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user