]> git.lizzy.rs Git - rust.git/commitdiff
Add basic documentation for with_capacity
authorCorey Richardson <corey@octayn.net>
Thu, 25 Apr 2013 02:33:13 +0000 (22:33 -0400)
committerCorey Richardson <corey@octayn.net>
Thu, 25 Apr 2013 02:33:13 +0000 (22:33 -0400)
src/libcore/vec.rs

index e478936ff65cc746529be05461976dae357252fa..f5ed574527d2d43b77248c4075b9daf8c26a3720 100644 (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);