Rollup merge of #61420 - felixrabe:patch-2, r=dtolnay

Succinctify splice docs
This commit is contained in:
Mazdak Farrokhzad 2019-06-04 04:48:16 +02:00 committed by GitHub
commit 1ae4727f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -2018,16 +2018,14 @@ impl<T> Vec<T> {
/// with the given `replace_with` iterator and yields the removed items.
/// `replace_with` does not need to be the same length as `range`.
///
/// Note 1: The element range is removed even if the iterator is not
/// consumed until the end.
/// The element range is removed even if the iterator is not consumed until the end.
///
/// Note 2: It is unspecified how many elements are removed from the vector,
/// It is unspecified how many elements are removed from the vector
/// if the `Splice` value is leaked.
///
/// Note 3: The input iterator `replace_with` is only consumed
/// when the `Splice` value is dropped.
/// The input iterator `replace_with` is only consumed when the `Splice` value is dropped.
///
/// Note 4: This is optimal if:
/// This is optimal if:
///
/// * The tail (elements in the vector after `range`) is empty,
/// * or `replace_with` yields fewer elements than `range`s length