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> {
735
735
unsafe { Self :: from_parts_in ( ptr, length, capacity, Global ) }
736
736
}
737
737
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
739
739
/// `None` if it is empty.
740
740
///
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
- ///
745
741
/// # Examples
746
742
///
747
743
/// Basic usage:
Original file line number Diff line number Diff line change @@ -2708,6 +2708,8 @@ fn test_peek_mut() {
2708
2708
assert_eq ! ( * p, 2 ) ;
2709
2709
* p = 0 ;
2710
2710
assert_eq ! ( * p, 0 ) ;
2711
+ p. pop ( ) ;
2712
+ assert_eq ! ( vec. len( ) , 1 ) ;
2711
2713
} else {
2712
2714
unreachable ! ( )
2713
2715
}
You can’t perform that action at this time.
0 commit comments