From d7a5aba2d3e1f348c88e10056d65c8d08e44f47b Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 29 Oct 2015 21:39:05 +0200 Subject: [PATCH] doc: fix and expand explanation I see that `extend()` is not called if new_len > len() --- src/libcollections/vec.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 897fea5309c..af4d94a4fa9 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -859,8 +859,9 @@ impl Vec { impl Vec { /// 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 ///