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.
wrapping_neg
1 parent d318878 commit ab38c6dCopy full SHA for ab38c6d
library/core/src/fmt/num.rs
@@ -219,9 +219,7 @@ macro_rules! impl_Display {
219
#[stable(feature = "rust1", since = "1.0.0")]
220
impl fmt::Display for $signed {
221
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
222
- let is_nonnegative = *self >= 0;
223
-
224
- if !is_nonnegative {
+ if *self < 0 {
225
#[cfg(not(feature = "optimize_for_size"))]
226
{
227
// convert the negative num to positive by summing 1 to its 2s complement
0 commit comments