@@ -60,11 +60,11 @@ trait GenericRadix {
60
60
// The radix can be as low as 2, so we need a buffer of at least 64
61
61
// characters for a base 2 number.
62
62
let zero = T :: zero ( ) ;
63
- let is_positive = x >= zero;
63
+ let is_nonnegative = x >= zero;
64
64
let mut buf = [ 0 ; 64 ] ;
65
65
let mut curr = buf. len ( ) ;
66
66
let base = T :: from_u8 ( self . base ( ) ) ;
67
- if is_positive {
67
+ if is_nonnegative {
68
68
// Accumulate each digit of the number from the least significant
69
69
// to the most significant figure.
70
70
for byte in buf. iter_mut ( ) . rev ( ) {
@@ -91,7 +91,7 @@ trait GenericRadix {
91
91
}
92
92
}
93
93
let buf = unsafe { str:: from_utf8_unchecked ( & buf[ curr..] ) } ;
94
- f. pad_integral ( is_positive , self . prefix ( ) , buf)
94
+ f. pad_integral ( is_nonnegative , self . prefix ( ) , buf)
95
95
}
96
96
}
97
97
@@ -268,8 +268,8 @@ macro_rules! impl_Display {
268
268
impl fmt:: Display for $t {
269
269
#[ allow( unused_comparisons) ]
270
270
fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
271
- let is_positive = * self >= 0 ;
272
- let mut n = if is_positive {
271
+ let is_nonnegative = * self >= 0 ;
272
+ let mut n = if is_nonnegative {
273
273
self . $conv_fn( )
274
274
} else {
275
275
// convert the negative num to positive by summing 1 to it's 2 complement
@@ -321,7 +321,7 @@ macro_rules! impl_Display {
321
321
str :: from_utf8_unchecked(
322
322
slice:: from_raw_parts( buf_ptr. offset( curr) , buf. len( ) - curr as usize ) )
323
323
} ;
324
- f. pad_integral( is_positive , "" , buf_slice)
324
+ f. pad_integral( is_nonnegative , "" , buf_slice)
325
325
}
326
326
} ) * ) ;
327
327
}
0 commit comments