File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -735,13 +735,9 @@ impl<T> Vec<T> {
735735 unsafe { Self :: from_parts_in ( ptr, length, capacity, Global ) }
736736 }
737737
738- /// Returns a mutable reference to the greatest item in the binary heap , or
738+ /// Returns a mutable reference to the last item in the vector , or
739739 /// `None` if it is empty.
740740 ///
741- /// Note: If the `PeekMut` value is leaked, some heap elements might get
742- /// leaked along with it, but the remaining elements will remain a valid
743- /// heap.
744- ///
745741 /// # Examples
746742 ///
747743 /// Basic usage:
Original file line number Diff line number Diff line change @@ -2708,6 +2708,8 @@ fn test_peek_mut() {
27082708 assert_eq ! ( * p, 2 ) ;
27092709 * p = 0 ;
27102710 assert_eq ! ( * p, 0 ) ;
2711+ p. pop ( ) ;
2712+ assert_eq ! ( vec. len( ) , 1 ) ;
27112713 } else {
27122714 unreachable ! ( )
27132715 }
You can’t perform that action at this time.
0 commit comments