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

Move to intra-doc links in collections/vec_deque.rs and collections/vec_deque/drain.rs #76877

Merged
merged 2 commits into from
Sep 20, 2020
Merged
Show file tree
Hide file tree
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
48 changes: 27 additions & 21 deletions library/alloc/src/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ const MAXIMUM_ZST_CAPACITY: usize = 1 << (core::mem::size_of::<usize>() * 8 - 1)
/// so that its elements do not wrap, and returns a mutable slice to the
/// now-contiguous element sequence.
///
/// [`push_back`]: #method.push_back
/// [`pop_front`]: #method.pop_front
/// [`extend`]: #method.extend
/// [`append`]: #method.append
/// [`make_contiguous`]: #method.make_contiguous
/// [`push_back`]: VecDeque::push_back
/// [`pop_front`]: VecDeque::pop_front
/// [`extend`]: VecDeque::extend
/// [`append`]: VecDeque::append
/// [`make_contiguous`]: VecDeque::make_contiguous
#[cfg_attr(not(test), rustc_diagnostic_item = "vecdeque_type")]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct VecDeque<T> {
Expand Down Expand Up @@ -640,7 +640,7 @@ impl<T> VecDeque<T> {
/// assert!(buf.capacity() >= 11);
/// ```
///
/// [`reserve`]: #method.reserve
/// [`reserve`]: VecDeque::reserve
#[stable(feature = "rust1", since = "1.0.0")]
pub fn reserve_exact(&mut self, additional: usize) {
self.reserve(additional);
Expand Down Expand Up @@ -987,8 +987,10 @@ impl<T> VecDeque<T> {
/// Returns a pair of slices which contain, in order, the contents of the
/// `VecDeque`.
///
/// If [`make_contiguous`](#method.make_contiguous) was previously called, all elements
/// of the `VecDeque` will be in the first slice and the second slice will be empty.
/// If [`make_contiguous`] was previously called, all elements of the
/// `VecDeque` will be in the first slice and the second slice will be empty.
///
/// [`make_contiguous`]: VecDeque::make_contiguous
///
/// # Examples
///
Expand Down Expand Up @@ -1020,8 +1022,10 @@ impl<T> VecDeque<T> {
/// Returns a pair of slices which contain, in order, the contents of the
/// `VecDeque`.
///
/// If [`make_contiguous`](#method.make_contiguous) was previously called, all elements
/// of the `VecDeque` will be in the first slice and the second slice will be empty.
/// If [`make_contiguous`] was previously called, all elements of the
/// `VecDeque` will be in the first slice and the second slice will be empty.
///
/// [`make_contiguous`]: VecDeque::make_contiguous
///
/// # Examples
///
Expand Down Expand Up @@ -2160,15 +2164,20 @@ impl<T> VecDeque<T> {
}
}

/// Rearranges the internal storage of this deque so it is one contiguous slice, which is then returned.
/// Rearranges the internal storage of this deque so it is one contiguous
/// slice, which is then returned.
///
/// This method does not allocate and does not change the order of the inserted elements.
/// As it returns a mutable slice, this can be used to sort or binary search a deque.
/// This method does not allocate and does not change the order of the
/// inserted elements. As it returns a mutable slice, this can be used to
/// sort or binary search a deque.
///
/// Once the internal storage is contiguous, the [`as_slices`](#method.as_slices) and
/// [`as_mut_slices`](#method.as_mut_slices) methods will return the entire contents of the
/// Once the internal storage is contiguous, the [`as_slices`] and
/// [`as_mut_slices`] methods will return the entire contents of the
/// `VecDeque` in a single slice.
///
/// [`as_slices`]: VecDeque::as_slices
/// [`as_mut_slices`]: VecDeque::as_mut_slices
///
/// # Examples
///
/// Sorting the content of a deque.
Expand Down Expand Up @@ -2495,8 +2504,7 @@ fn count(tail: usize, head: usize, size: usize) -> usize {
/// This `struct` is created by the [`iter`] method on [`VecDeque`]. See its
/// documentation for more.
///
/// [`iter`]: struct.VecDeque.html#method.iter
/// [`VecDeque`]: struct.VecDeque.html
/// [`iter`]: VecDeque::iter
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Iter<'a, T: 'a> {
ring: &'a [T],
Expand Down Expand Up @@ -2650,8 +2658,7 @@ impl<T> FusedIterator for Iter<'_, T> {}
/// This `struct` is created by the [`iter_mut`] method on [`VecDeque`]. See its
/// documentation for more.
///
/// [`iter_mut`]: struct.VecDeque.html#method.iter_mut
/// [`VecDeque`]: struct.VecDeque.html
/// [`iter_mut`]: VecDeque::iter_mut
#[stable(feature = "rust1", since = "1.0.0")]
pub struct IterMut<'a, T: 'a> {
ring: &'a mut [T],
Expand Down Expand Up @@ -2756,8 +2763,7 @@ impl<T> FusedIterator for IterMut<'_, T> {}
/// This `struct` is created by the [`into_iter`] method on [`VecDeque`]
/// (provided by the `IntoIterator` trait). See its documentation for more.
///
/// [`into_iter`]: struct.VecDeque.html#method.into_iter
/// [`VecDeque`]: struct.VecDeque.html
/// [`into_iter`]: VecDeque::into_iter
#[derive(Clone)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct IntoIter<T> {
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/collections/vec_deque/drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use super::{count, Iter, VecDeque};
/// This `struct` is created by the [`drain`] method on [`VecDeque`]. See its
/// documentation for more.
///
/// [`drain`]: struct.VecDeque.html#method.drain
/// [`VecDeque`]: struct.VecDeque.html
/// [`drain`]: VecDeque::drain
#[stable(feature = "drain", since = "1.6.0")]
pub struct Drain<'a, T: 'a> {
pub(crate) after_tail: usize,
Expand Down