We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fee95d4 + b0c4bae commit 6b32f28Copy full SHA for 6b32f28
core/src/num/uint_macros.rs
@@ -584,11 +584,11 @@ macro_rules! uint_impl {
584
// Thus, rather than using `overflowing_sub` that produces a wrapping
585
// subtraction, check it ourself so we can use an unchecked one.
586
587
- if self >= rhs {
+ if self < rhs {
588
+ None
589
+ } else {
590
// SAFETY: just checked this can't overflow
591
Some(unsafe { intrinsics::unchecked_sub(self, rhs) })
- } else {
- None
592
}
593
594
0 commit comments