Skip to content

Commit 92bf9b6

Browse files
committed
Add basic documentation for with_capacity
1 parent 1d53bab commit 92bf9b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcore/vec.rs

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ pub fn from_slice<T:Copy>(t: &[T]) -> ~[T] {
173173
from_fn(t.len(), |i| t[i])
174174
}
175175

176+
/// Creates a new vector with a capacity of `capacity`
176177
pub fn with_capacity<T>(capacity: uint) -> ~[T] {
177178
let mut vec = ~[];
178179
reserve(&mut vec, capacity);

0 commit comments

Comments
 (0)