Skip to content

Commit 481b354

Browse files
committed
Simplify the overflowing_neg expression
1 parent 26a3540 commit 481b354

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self
15301530
#[inline]
15311531
#[stable(feature = "wrapping", since = "1.7.0")]
15321532
pub const fn overflowing_neg(self) -> (Self, bool) {
1533-
((self ^ -1).wrapping_add(1), self == Self::min_value())
1533+
((!self).wrapping_add(1), self == Self::min_value())
15341534
}
15351535
}
15361536

0 commit comments

Comments
 (0)