about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-10-30 01:28:12 +0000
committerbors <bors@rust-lang.org>2015-10-30 01:28:12 +0000
commit914c4dbc2a1037e63625b0bf846c6b550d0918c7 (patch)
tree82be77b2f588df516bc3335ef67b844d577c32a2
parent2e07996a9b6d7cd0991deab14b2d3f9ebc81ecaf (diff)
parentd7a5aba2d3e1f348c88e10056d65c8d08e44f47b (diff)
downloadrust-914c4dbc2a1037e63625b0bf846c6b550d0918c7.tar.gz
rust-914c4dbc2a1037e63625b0bf846c6b550d0918c7.zip
Auto merge of #29458 - tshepang:better, r=alexcrichton
I see that `extend()` is not called if new_len > len()
-rw-r--r--src/libcollections/vec.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index adf3ec13cfd..a0ca2e4d36a 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -859,8 +859,9 @@ impl<T> Vec<T> {
 impl<T: Clone> Vec<T> {
     /// Resizes the `Vec` in-place so that `len()` is equal to `new_len`.
     ///
-    /// Calls either `extend()` or `truncate()` depending on whether `new_len`
-    /// is larger than the current value of `len()` or not.
+    /// If `new_len` is greater than `len()`, the `Vec` is extended by the
+    /// difference, with each additional slot filled with `value`.
+    /// If `new_len` is less than `len()`, the `Vec` is simply truncated.
     ///
     /// # Examples
     ///