Skip to content

Commit

Permalink
Rollup merge of rust-lang#65739 - mqudsi:vec_split_off_docs, r=dtolnay
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JohnTitor authored Nov 17, 2019
2 parents 2cdc289 + a36c3f6 commit d8f2526
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,10 +1333,9 @@ 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.
/// Returns a newly allocated vector containing the elements in the range
/// `[at, len)`. After the call, the original vector will be left containing
/// the elements `[0, at)` with its previous capacity unchanged.
///
/// # Panics
///
Expand Down

0 comments on commit d8f2526

Please sign in to comment.