Skip to content

Commit fcf2426

Browse files
committed
fix: BinaryHeap<T: Ord>::peek_mut
1 parent 845da88 commit fcf2426

File tree

1 file changed

+2
-2
lines changed
  • library/alloc/src/collections/binary_heap

1 file changed

+2
-2
lines changed

‎library/alloc/src/collections/binary_heap/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,9 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
581581
pub fn with_capacity_in(capacity: usize, alloc: A) -> BinaryHeap<T, A> {
582582
BinaryHeap { data: Vec::with_capacity_in(capacity, alloc) }
583583
}
584+
}
584585

586+
impl<T: Ord, A: Allocator> BinaryHeap<T, A> {
585587
/// Returns a mutable reference to the greatest item in the binary heap, or
586588
/// `None` if it is empty.
587589
///
@@ -615,9 +617,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
615617
pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, A>> {
616618
if self.is_empty() { None } else { Some(PeekMut { heap: self, original_len: None }) }
617619
}
618-
}
619620

620-
impl<T: Ord, A: Allocator> BinaryHeap<T, A> {
621621
/// Removes the greatest item from the binary heap and returns it, or `None` if it
622622
/// is empty.
623623
///

0 commit comments

Comments
 (0)