@@ -60,11 +60,11 @@ trait GenericRadix {
6060 // The radix can be as low as 2, so we need a buffer of at least 64
6161 // characters for a base 2 number.
6262 let zero = T :: zero ( ) ;
63- let is_positive = x >= zero;
63+ let is_nonnegative = x >= zero;
6464 let mut buf = [ 0 ; 64 ] ;
6565 let mut curr = buf. len ( ) ;
6666 let base = T :: from_u8 ( self . base ( ) ) ;
67- if is_positive {
67+ if is_nonnegative {
6868 // Accumulate each digit of the number from the least significant
6969 // to the most significant figure.
7070 for byte in buf. iter_mut ( ) . rev ( ) {
@@ -91,7 +91,7 @@ trait GenericRadix {
9191 }
9292 }
9393 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)
9595 }
9696}
9797
@@ -268,8 +268,8 @@ macro_rules! impl_Display {
268268 impl fmt:: Display for $t {
269269 #[ allow( unused_comparisons) ]
270270 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 {
273273 self . $conv_fn( )
274274 } else {
275275 // convert the negative num to positive by summing 1 to it's 2 complement
@@ -321,7 +321,7 @@ macro_rules! impl_Display {
321321 str :: from_utf8_unchecked(
322322 slice:: from_raw_parts( buf_ptr. offset( curr) , buf. len( ) - curr as usize ) )
323323 } ;
324- f. pad_integral( is_positive , "" , buf_slice)
324+ f. pad_integral( is_nonnegative , "" , buf_slice)
325325 }
326326 } ) * ) ;
327327}
0 commit comments