about summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorChan Kwan Yin <sofe2038@gmail.com>2021-01-29 12:21:53 +0800
committerGitHub <noreply@github.com>2021-01-29 12:21:53 +0800
commit02094f99620b6e2f9c97e25d39fd6ada6a558adf (patch)
treeddd44044ef12ce506499d2096e60d69942afdea9 /library/alloc/src/vec
parent74500b99783d126e330184f0392a78f8b93b73ef (diff)
downloadrust-02094f99620b6e2f9c97e25d39fd6ada6a558adf.tar.gz
rust-02094f99620b6e2f9c97e25d39fd6ada6a558adf.zip
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
Diffstat (limited to 'library/alloc/src/vec')
-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.