priority_queue: add docstring for from_vec

This commit is contained in:
Daniel Micay 2012-12-15 14:29:38 -05:00 committed by Brian Anderson
parent b3463ea657
commit ac695aa21a

View File

@ -93,6 +93,7 @@ impl <T: Ord> PriorityQueue<T> {
q.to_vec() q.to_vec()
} }
/// Create a PriorityQueue from a vector (heapify)
static pub pure fn from_vec(xs: ~[T]) -> PriorityQueue<T> { static pub pure fn from_vec(xs: ~[T]) -> PriorityQueue<T> {
let mut q = PriorityQueue{data: xs,}; let mut q = PriorityQueue{data: xs,};
let mut n = q.len() / 2; let mut n = q.len() / 2;