Skip to content

Commit c249108

Browse files
committed
Fix rem condition
1 parent 46eaf11 commit c249108

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/core/src/num/int_macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,9 @@ macro_rules! int_impl {
695695
// SAFETY: div by zero and by INT_MIN have been checked above
696696
unsafe {
697697
if unlikely!(intrinsics::unchecked_rem(self, rhs) == 0) {
698-
None
699-
} else {
700698
Some(intrinsics::unchecked_div(self, rhs))
699+
} else {
700+
None
701701
}
702702
}
703703
}

library/core/src/num/uint_macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,9 @@ macro_rules! uint_impl {
681681
// failure modes for division
682682
unsafe {
683683
if unlikely!(intrinsics::unchecked_rem(self, rhs) == 0) {
684-
None
685-
} else {
686684
Some(intrinsics::unchecked_div(self, rhs))
685+
} else {
686+
None
687687
}
688688
}
689689
}

0 commit comments

Comments
 (0)