Skip to content

Commit 8c7530a

Browse files
committed
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.
1 parent 5f00849 commit 8c7530a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/liballoc/vec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,10 +1333,10 @@ 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+
/// Copies the range from `[at, len)` to a newly allocated `Self`
1337+
/// and returns the result. The original `Self` will contain the
1338+
/// range from `[0, at)`. Note that the capacity of `self` does
1339+
/// not change.
13401340
///
13411341
/// # Panics
13421342
///

0 commit comments

Comments
 (0)