about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-30 13:36:55 +0900
committerGitHub <noreply@github.com>2021-01-30 13:36:55 +0900
commit0f11a943cc73b1110961e45c2a7aeee3ceef73e4 (patch)
tree29554dd946578cdeaffd4c04fe1ed806b01e5623
parentb43c1d50b780f194298f85587b2912c0058c8481 (diff)
parent02094f99620b6e2f9c97e25d39fd6ada6a558adf (diff)
downloadrust-0f11a943cc73b1110961e45c2a7aeee3ceef73e4.tar.gz
rust-0f11a943cc73b1110961e45c2a7aeee3ceef73e4.zip
Rollup merge of #81499 - SOF3:patch-1, r=sanxiyn
Updated Vec::splice documentation

Replacing with equal number of values does not increase the length of the vec.

Reference: https://stackoverflow.com/a/62559271/3990767
-rw-r--r--library/alloc/src/vec/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 13fcf5207e0..9aea19f04c6 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2211,7 +2211,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// This is optimal if:
     ///
     /// * The tail (elements in the vector after `range`) is empty,
-    /// * or `replace_with` yields fewer elements than `range`’s length
+    /// * or `replace_with` yields fewer or equal elements than `range`’s length
     /// * or the lower bound of its `size_hint()` is exact.
     ///
     /// Otherwise, a temporary vector is allocated and the tail is moved twice.