Add basic documentation for with_capacity

This commit is contained in:
Corey Richardson 2013-04-24 22:33:13 -04:00
parent 1d53babd2f
commit 92bf9b68da

View File

@ -173,6 +173,7 @@ pub fn from_slice<T:Copy>(t: &[T]) -> ~[T] {
from_fn(t.len(), |i| t[i])
}
/// Creates a new vector with a capacity of `capacity`
pub fn with_capacity<T>(capacity: uint) -> ~[T] {
let mut vec = ~[];
reserve(&mut vec, capacity);