Skip to content

Commit 02094f9

Browse files
authored
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
1 parent 74500b9 commit 02094f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/vec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,7 @@ impl<T, A: Allocator> Vec<T, A> {
22112211
/// This is optimal if:
22122212
///
22132213
/// * The tail (elements in the vector after `range`) is empty,
2214-
/// * or `replace_with` yields fewer elements than `range`’s length
2214+
/// * or `replace_with` yields fewer or equal elements than `range`’s length
22152215
/// * or the lower bound of its `size_hint()` is exact.
22162216
///
22172217
/// Otherwise, a temporary vector is allocated and the tail is moved twice.

0 commit comments

Comments
 (0)