Skip to content

Commit d8f2526

Browse files
authored
Rollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay
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.
2 parents 2cdc289 + a36c3f6 commit d8f2526

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/liballoc/vec.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1333,10 +1333,9 @@ impl<T> Vec<T> {
13331333

13341334
/// Splits the collection into two at the given index.
13351335
///
1336-
/// Returns a newly allocated `Self`. `self` contains elements `[0, at)`,
1337-
/// and the returned `Self` contains elements `[at, len)`.
1338-
///
1339-
/// Note that the capacity of `self` does not change.
1336+
/// Returns a newly allocated vector containing the elements in the range
1337+
/// `[at, len)`. After the call, the original vector will be left containing
1338+
/// the elements `[0, at)` with its previous capacity unchanged.
13401339
///
13411340
/// # Panics
13421341
///

0 commit comments

Comments
 (0)