From 81e6840ff445f5eb9c99ba506aa89b8fc2a1a4c7 Mon Sep 17 00:00:00 2001 From: Pieter Penninckx Date: Fri, 19 Jan 2018 16:51:46 +0100 Subject: [PATCH 1/2] Small improvements to the documentation of VecDeque. --- src/liballoc/vec_deque.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/liballoc/vec_deque.rs b/src/liballoc/vec_deque.rs index f56aa23a4eb2f..7d15b790b24ad 100644 --- a/src/liballoc/vec_deque.rs +++ b/src/liballoc/vec_deque.rs @@ -906,7 +906,7 @@ impl VecDeque { } } - /// Clears the buffer, removing all values. + /// Clears the `VecDeque`, removing all values. /// /// # Examples /// @@ -1624,10 +1624,10 @@ impl VecDeque { return elem; } - /// Splits the collection into two at the given index. + /// Splits the `VecDeque` into two at the given index. /// - /// Returns a newly allocated `Self`. `self` contains elements `[0, at)`, - /// and the returned `Self` contains elements `[at, len)`. + /// Returns a newly allocated `VecDeque`. `self` contains elements `[0, at)`, + /// and the returned `VecDeque` contains elements `[at, len)`. /// /// Note that the capacity of `self` does not change. /// @@ -1635,7 +1635,7 @@ impl VecDeque { /// /// # Panics /// - /// Panics if `at > len` + /// Panics if `at` is out of bounds. /// /// # Examples /// @@ -1815,7 +1815,8 @@ impl VecDeque { impl VecDeque { /// Modifies the `VecDeque` in-place so that `len()` is equal to new_len, - /// either by removing excess elements or by appending clones of `value` to the back. + /// either by removing excess elements from the back or by appending clones of `value` + /// to the back. /// /// # Examples /// @@ -2390,7 +2391,7 @@ impl IntoIterator for VecDeque { type Item = T; type IntoIter = IntoIter; - /// Consumes the list into a front-to-back iterator yielding elements by + /// Consumes the `VecDeque` into a front-to-back iterator yielding elements by /// value. fn into_iter(self) -> IntoIter { IntoIter { inner: self } From ea814b84630ee878c18ad1abff47a0e5236a2ad5 Mon Sep 17 00:00:00 2001 From: Pieter Penninckx Date: Sun, 21 Jan 2018 15:05:53 +0100 Subject: [PATCH 2/2] Revert change to docs in panic section of VecDeque::split_off --- src/liballoc/vec_deque.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/vec_deque.rs b/src/liballoc/vec_deque.rs index 7d15b790b24ad..4b167bd20bfbe 100644 --- a/src/liballoc/vec_deque.rs +++ b/src/liballoc/vec_deque.rs @@ -1635,7 +1635,7 @@ impl VecDeque { /// /// # Panics /// - /// Panics if `at` is out of bounds. + /// Panics if `at > len`. /// /// # Examples ///