未验证 提交 0f11a943 编写于 作者: Y Yuki Okushi 提交者: GitHub

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
......@@ -2211,7 +2211,7 @@ fn extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) {
/// 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册