diff options
| author | Mahmoud Al-Qudsi <mqudsi@neosmart.net> | 2019-10-23 16:32:16 -0500 |
|---|---|---|
| committer | Mahmoud Al-Qudsi <mqudsi@neosmart.net> | 2019-11-16 14:15:07 -0600 |
| commit | 8c7530ade81b14d48ebc7cdd5e5fbdc0d9612bbe (patch) | |
| tree | 0b625e8124fe87abfc5ab26c6337827897979ed8 /src/liballoc | |
| parent | 5f00849dc495f97ea9eeef07b958664bfb755ae3 (diff) | |
| download | rust-8c7530ade81b14d48ebc7cdd5e5fbdc0d9612bbe.tar.gz rust-8c7530ade81b14d48ebc7cdd5e5fbdc0d9612bbe.zip | |
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.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 4363314dc45..963b012c711 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -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 /// |
