about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolette Verlinden <nicole@nicole.moe>2015-07-28 23:53:25 -0500
committerNicolette Verlinden <nicole@nicole.moe>2015-07-28 23:53:25 -0500
commit48606e3ecdc2d206e130722aa2055bfe42fbe44b (patch)
treec93f2ce4d5c716c2563270ef8d45f4136b95e45f /src
parent68fc2d98d547a7045e918b03117c740179addb77 (diff)
Mention vec![x; len] syntax in Vec docs
Diffstat (limited to 'src')
-rw-r--r--src/libcollections/vec.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index e9f3651d63b..8b205716152 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -112,6 +112,13 @@ use super::range::RangeArgument;
 /// assert_eq!(vec, [1, 2, 3, 4]);
 /// ```
 ///
+/// It can also initialize each element of a `Vec<T>` with a given value:
+///
+/// ```
+/// let vec = vec![0; 5];
+/// assert_eq!(vec, [0, 0, 0, 0, 0]);
+/// ```
+///
 /// Use a `Vec<T>` as an efficient stack:
 ///
 /// ```