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
This commit is contained in:
parent
74500b9978
commit
02094f9962
1 changed files with 1 additions and 1 deletions
|
@ -2211,7 +2211,7 @@ impl<T, A: Allocator> Vec<T, A> {
|
||||||
/// This is optimal if:
|
/// This is optimal if:
|
||||||
///
|
///
|
||||||
/// * The tail (elements in the vector after `range`) is empty,
|
/// * 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.
|
/// * or the lower bound of its `size_hint()` is exact.
|
||||||
///
|
///
|
||||||
/// Otherwise, a temporary vector is allocated and the tail is moved twice.
|
/// Otherwise, a temporary vector is allocated and the tail is moved twice.
|
||||||
|
|
Loading…
Reference in a new issue