Skip to content

Commit d21fdf2

Browse files
Update library/core/src/num/nonzero.rs
Co-authored-by: Carolyn Zech <[email protected]>
1 parent 233c41c commit d21fdf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/num/nonzero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
15301530
})]
15311531
#[ensures(|result: &Self| {
15321532
// Postcondition: the result matches the expected addition
1533-
self.get().checked_add(other).unwrap() == result.get()
1533+
self.get().checked_add(other).is_some_and(|sum| sum == result.get())
15341534
})]
15351535
pub const unsafe fn unchecked_add(self, other: $Int) -> Self {
15361536
// SAFETY: The caller ensures there is no overflow.

0 commit comments

Comments
 (0)