We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 233c41c commit d21fdf2Copy full SHA for d21fdf2
library/core/src/num/nonzero.rs
@@ -1530,7 +1530,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
1530
})]
1531
#[ensures(|result: &Self| {
1532
// Postcondition: the result matches the expected addition
1533
- self.get().checked_add(other).unwrap() == result.get()
+ self.get().checked_add(other).is_some_and(|sum| sum == result.get())
1534
1535
pub const unsafe fn unchecked_add(self, other: $Int) -> Self {
1536
// SAFETY: The caller ensures there is no overflow.
0 commit comments