diff options
| author | Corey Richardson <corey@octayn.net> | 2013-04-24 22:33:13 -0400 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2013-04-24 22:33:13 -0400 |
| commit | 92bf9b68da05504e925e2b66ceb9f3e5f1a5b0ee (patch) | |
| tree | 67c27c1ded1c9dab1d51d6dc976143dc8c91a718 /src/libcore | |
| parent | 1d53babd2f23439975518fda94d9122b15e779c9 (diff) | |
| download | rust-92bf9b68da05504e925e2b66ceb9f3e5f1a5b0ee.tar.gz rust-92bf9b68da05504e925e2b66ceb9f3e5f1a5b0ee.zip | |
Add basic documentation for with_capacity
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/vec.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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: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); |
