Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements to the documentation of VecDeque. #47595

Merged
merged 2 commits into from
Jan 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/liballoc/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ impl<T> VecDeque<T> {
}
}

/// Clears the buffer, removing all values.
/// Clears the `VecDeque`, removing all values.
///
/// # Examples
///
Expand Down Expand Up @@ -1624,18 +1624,18 @@ impl<T> VecDeque<T> {
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.
///
/// Element at index 0 is the front of the queue.
///
/// # Panics
///
/// Panics if `at > len`
/// Panics if `at > len`.
///
/// # Examples
///
Expand Down Expand Up @@ -1815,7 +1815,8 @@ impl<T> VecDeque<T> {

impl<T: Clone> VecDeque<T> {
/// 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
///
Expand Down Expand Up @@ -2390,7 +2391,7 @@ impl<T> IntoIterator for VecDeque<T> {
type Item = T;
type IntoIter = IntoIter<T>;

/// 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<T> {
IntoIter { inner: self }
Expand Down