Simplify the overflowing_neg expression
This commit is contained in:
parent
26a354065c
commit
481b354c97
1 changed files with 1 additions and 1 deletions
|
|
@ -1530,7 +1530,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self
|
|||
#[inline]
|
||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||
pub const fn overflowing_neg(self) -> (Self, bool) {
|
||||
((self ^ -1).wrapping_add(1), self == Self::min_value())
|
||||
((!self).wrapping_add(1), self == Self::min_value())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue