diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-10-29 21:39:05 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-10-29 21:40:56 +0200 |
| commit | d7a5aba2d3e1f348c88e10056d65c8d08e44f47b (patch) | |
| tree | 65b88836671ad78ba42d62c9ad3828369210afff /src | |
| parent | 01fd4d622746f03334a6543c1476e5e65712b1cc (diff) | |
| download | rust-d7a5aba2d3e1f348c88e10056d65c8d08e44f47b.tar.gz rust-d7a5aba2d3e1f348c88e10056d65c8d08e44f47b.zip | |
doc: fix and expand explanation
I see that `extend()` is not called if new_len > len()
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcollections/vec.rs | 5 |
1 files 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<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 /// |
