Skip to content

Commit

Permalink
Check that PeekMaxMut has a parent before reading it
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper authored and tov committed Dec 20, 2021
1 parent 8d92897 commit f9c0d89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,10 @@ mod tests {
assert_eq!(1, h.peek_max_mut().unwrap().pop());
assert_eq!(Some(&0), h.peek_min());
assert_eq!(Some(&0), h.peek_max());

*h.peek_max_mut().unwrap() = 1;
assert_eq!(Some(&1), h.peek_min());
assert_eq!(Some(&1), h.peek_max());
}

#[test]
Expand Down

0 comments on commit f9c0d89

Please sign in to comment.