From 92bf9b68da05504e925e2b66ceb9f3e5f1a5b0ee Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Wed, 24 Apr 2013 22:33:13 -0400 Subject: [PATCH] Add basic documentation for with_capacity --- src/libcore/vec.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index e478936ff65..f5ed574527d 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -173,6 +173,7 @@ pub fn from_slice(t: &[T]) -> ~[T] { from_fn(t.len(), |i| t[i]) } +/// Creates a new vector with a capacity of `capacity` pub fn with_capacity(capacity: uint) -> ~[T] { let mut vec = ~[]; reserve(&mut vec, capacity);