1
Fork 0

Improve documentation of Vec::split_off(...)

The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.
This commit is contained in:
Mahmoud Al-Qudsi 2019-10-23 16:32:16 -05:00
parent 5f00849dc4
commit 8c7530ade8

View file

@ -1333,10 +1333,10 @@ impl<T> Vec<T> {
/// Splits the collection into two at the given index.
///
/// Returns a newly allocated `Self`. `self` contains elements `[0, at)`,
/// and the returned `Self` contains elements `[at, len)`.
///
/// Note that the capacity of `self` does not change.
/// Copies the range from `[at, len)` to a newly allocated `Self`
/// and returns the result. The original `Self` will contain the
/// range from `[0, at)`. Note that the capacity of `self` does
/// not change.
///
/// # Panics
///