33//! Insertion and popping the largest element have *O*(log(*n*)) time complexity.
44//! Checking the largest element is *O*(1). Converting a vector to a binary heap
55//! can be done in-place, and has *O*(*n*) complexity. A binary heap can also be
6- //! converted to a sorted vector in-place, allowing it to be used for an *O*(*n* \ * log(*n*))
6+ //! converted to a sorted vector in-place, allowing it to be used for an *O*(*n* * log(*n*))
77//! in-place heapsort.
88//!
99//! # Examples
@@ -159,9 +159,9 @@ use super::SpecExtend;
159159/// This will be a max-heap.
160160///
161161/// It is a logic error for an item to be modified in such a way that the
162- /// item's ordering relative to any other item, as determined by the `Ord`
162+ /// item's ordering relative to any other item, as determined by the [ `Ord`]
163163/// trait, changes while it is in the heap. This is normally only possible
164- /// through `Cell`, `RefCell`, global state, I/O, or unsafe code. The
164+ /// through [ `Cell`], [ `RefCell`] , global state, I/O, or unsafe code. The
165165/// behavior resulting from such a logic error is not specified, but will
166166/// not result in undefined behavior. This could include panics, incorrect
167167/// results, aborts, memory leaks, and non-termination.
@@ -219,7 +219,7 @@ use super::SpecExtend;
219219///
220220/// ## Min-heap
221221///
222- /// Either `std ::cmp::Reverse` or a custom `Ord` implementation can be used to
222+ /// Either [`core ::cmp::Reverse`] or a custom [ `Ord`] implementation can be used to
223223/// make `BinaryHeap` a min-heap. This makes `heap.pop()` return the smallest
224224/// value instead of the greatest one.
225225///
@@ -243,13 +243,17 @@ use super::SpecExtend;
243243///
244244/// # Time complexity
245245///
246- /// | [push] | [pop] | [peek]/[peek\_mut] |
247- /// |--------| -----------|--------------------|
248- /// | O (1)~ | *O*(log(*n*)) | *O*(1) |
246+ /// | [push] | [pop] | [peek]/[peek\_mut] |
247+ /// |---------|---- -----------|--------------------|
248+ /// | *O* (1)~ | *O*(log(*n*)) | *O*(1) |
249249///
250250/// The value for `push` is an expected cost; the method documentation gives a
251251/// more detailed analysis.
252252///
253+ /// [`core::cmp::Reverse`]: core::cmp::Reverse
254+ /// [`Ord`]: core::cmp::Ord
255+ /// [`Cell`]: core::cell::Cell
256+ /// [`RefCell`]: core::cell::RefCell
253257/// [push]: BinaryHeap::push
254258/// [pop]: BinaryHeap::pop
255259/// [peek]: BinaryHeap::peek
@@ -1255,9 +1259,10 @@ impl<T> FusedIterator for Iter<'_, T> {}
12551259/// An owning iterator over the elements of a `BinaryHeap`.
12561260///
12571261/// This `struct` is created by [`BinaryHeap::into_iter()`]
1258- /// (provided by the `IntoIterator` trait). See its documentation for more.
1262+ /// (provided by the [ `IntoIterator`] trait). See its documentation for more.
12591263///
12601264/// [`into_iter`]: BinaryHeap::into_iter
1265+ /// [`IntoIterator`]: core::iter::IntoIterator
12611266#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12621267#[ derive( Clone ) ]
12631268pub struct IntoIter < T > {
0 commit comments