1
Fork 0

Convert vec::{reserve, reserve_at_least, capacity} to methods.

This commit is contained in:
Huon Wilson 2013-06-28 00:40:47 +10:00
parent ae2f185349
commit 32d655916f
7 changed files with 88 additions and 90 deletions

View file

@ -52,12 +52,12 @@ impl<T:Ord> PriorityQueue<T> {
}
/// Returns the number of elements the queue can hold without reallocating
pub fn capacity(&self) -> uint { vec::capacity(&self.data) }
pub fn capacity(&self) -> uint { self.data.capacity() }
pub fn reserve(&mut self, n: uint) { vec::reserve(&mut self.data, n) }
pub fn reserve(&mut self, n: uint) { self.data.reserve(n) }
pub fn reserve_at_least(&mut self, n: uint) {
vec::reserve_at_least(&mut self.data, n)
self.data.reserve_at_least(n)
}
/// Pop the greatest item from the queue - fails if empty