Add basic documentation for with_capacity
This commit is contained in:
parent
1d53babd2f
commit
92bf9b68da
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user