18
18
//! [dijkstra]: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
19
19
//! [sssp]: https://en.wikipedia.org/wiki/Shortest_path_problem
20
20
//! [dir_graph]: https://en.wikipedia.org/wiki/Directed_graph
21
- //! [`BinaryHeap`]: struct.BinaryHeap.html
22
21
//!
23
22
//! ```
24
23
//! use std::cmp::Ordering;
146
145
//! }
147
146
//! ```
148
147
149
- #![ cfg_attr( rustc_1_52, deny( unsafe_op_in_unsafe_fn) ) ]
150
- #![ cfg_attr( not( rustc_1_52) , allow( unused_unsafe) ) ]
148
+ #![ deny( unsafe_op_in_unsafe_fn) ]
151
149
#![ allow( clippy:: needless_doctest_main) ]
152
150
#![ allow( missing_docs) ]
153
151
// #![stable(feature = "rust1", since = "1.0.0")]
@@ -264,10 +262,10 @@ use std::vec;
264
262
/// [`Ord`]: https://doc.rust-lang.org/stable/core/cmp/trait.Ord.html
265
263
/// [`Cell`]: https://doc.rust-lang.org/stable/core/cell/struct.Cell.html
266
264
/// [`RefCell`]: https://doc.rust-lang.org/stable/core/cell/struct.RefCell.html
267
- /// [push]: #method. push
268
- /// [pop]: #method. pop
269
- /// [peek]: #method. peek
270
- /// [peek\_mut]: #method. peek_mut
265
+ /// [push]: BinaryHeap:: push
266
+ /// [pop]: BinaryHeap:: pop
267
+ /// [peek]: BinaryHeap:: peek
268
+ /// [peek\_mut]: BinaryHeap:: peek_mut
271
269
// #[stable(feature = "rust1", since = "1.0.0")]
272
270
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
273
271
pub struct BinaryHeap < T , C = MaxComparator > {
@@ -333,8 +331,7 @@ where
333
331
/// This `struct` is created by the [`peek_mut`] method on [`BinaryHeap`]. See
334
332
/// its documentation for more.
335
333
///
336
- /// [`peek_mut`]: struct.BinaryHeap.html#method.peek_mut
337
- /// [`BinaryHeap`]: struct.BinaryHeap.html
334
+ /// [`peek_mut`]: BinaryHeap::peek_mut
338
335
// #[stable(feature = "binary_heap_peek_mut", since = "1.12.0")]
339
336
pub struct PeekMut < ' a , T : ' a , C : ' a + Compare < T > > {
340
337
heap : & ' a mut BinaryHeap < T , C > ,
@@ -1196,7 +1193,7 @@ impl<T, C> BinaryHeap<T, C> {
1196
1193
/// heap.push(4);
1197
1194
/// ```
1198
1195
///
1199
- /// [`reserve`]: #method. reserve
1196
+ /// [`reserve`]: BinaryHeap:: reserve
1200
1197
// #[stable(feature = "rust1", since = "1.0.0")]
1201
1198
pub fn reserve_exact ( & mut self , additional : usize ) {
1202
1199
self . data . reserve_exact ( additional) ;
@@ -1468,8 +1465,6 @@ impl<T> Drop for Hole<'_, T> {
1468
1465
///
1469
1466
/// This `struct` is created by [`BinaryHeap::iter()`]. See its
1470
1467
/// documentation for more.
1471
- ///
1472
- /// [`BinaryHeap::iter()`]: struct.BinaryHeap.html#method.iter
1473
1468
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
1474
1469
// #[stable(feature = "rust1", since = "1.0.0")]
1475
1470
pub struct Iter < ' a , T : ' a > {
@@ -1536,7 +1531,6 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
1536
1531
/// This `struct` is created by [`BinaryHeap::into_iter()`]
1537
1532
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
1538
1533
///
1539
- /// [`BinaryHeap::into_iter()`]: struct.BinaryHeap.html#method.into_iter
1540
1534
/// [`IntoIterator`]: https://doc.rust-lang.org/stable/core/iter/trait.IntoIterator.html
1541
1535
// #[stable(feature = "rust1", since = "1.0.0")]
1542
1536
#[ derive( Clone ) ]
@@ -1612,8 +1606,6 @@ impl<T, C: Compare<T>> Iterator for IntoIterSorted<T, C> {
1612
1606
///
1613
1607
/// This `struct` is created by [`BinaryHeap::drain()`]. See its
1614
1608
/// documentation for more.
1615
- ///
1616
- /// [`BinaryHeap::drain()`]: struct.BinaryHeap.html#method.drain
1617
1609
// #[stable(feature = "drain", since = "1.6.0")]
1618
1610
#[ derive( Debug ) ]
1619
1611
pub struct Drain < ' a , T : ' a > {
@@ -1682,11 +1674,6 @@ impl<T: Ord, const N: usize> From<[T; N]> for BinaryHeap<T> {
1682
1674
}
1683
1675
}
1684
1676
1685
- /// # Compatibility
1686
- ///
1687
- /// This trait is only implemented for Rust 1.41.0 or greater. For earlier versions, `Into<Vec<T>>`
1688
- /// is implemented for `BinaryHeap<T, C>` instead.
1689
- #[ cfg( rustc_1_41) ]
1690
1677
impl < T , C > From < BinaryHeap < T , C > > for Vec < T > {
1691
1678
/// Converts a `BinaryHeap<T>` into a `Vec<T>`.
1692
1679
///
@@ -1697,17 +1684,6 @@ impl<T, C> From<BinaryHeap<T, C>> for Vec<T> {
1697
1684
}
1698
1685
}
1699
1686
1700
- #[ cfg( not( rustc_1_41) ) ]
1701
- impl < T , C > Into < Vec < T > > for BinaryHeap < T , C > {
1702
- /// Converts a `BinaryHeap<T>` into a `Vec<T>`.
1703
- ///
1704
- /// This conversion requires no data movement or allocation, and has
1705
- /// constant time complexity.
1706
- fn into ( self ) -> Vec < T > {
1707
- self . data
1708
- }
1709
- }
1710
-
1711
1687
// #[stable(feature = "rust1", since = "1.0.0")]
1712
1688
impl < T : Ord > FromIterator < T > for BinaryHeap < T > {
1713
1689
fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> Self {
0 commit comments