File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -219,17 +219,13 @@ macro_rules! impl_Display {
219219 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
220220 impl fmt:: Display for $signed {
221221 fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
222- let is_nonnegative = * self >= 0 ;
223-
224- if !is_nonnegative {
222+ if * self < 0 {
225223 #[ cfg( not( feature = "optimize_for_size" ) ) ]
226224 {
227- // convert the negative num to positive by summing 1 to its 2s complement
228225 return ( !self as $unsigned) . wrapping_add( 1 ) . _fmt( false , f) ;
229226 }
230227 #[ cfg( feature = "optimize_for_size" ) ]
231228 {
232- // convert the negative num to positive by summing 1 to its 2s complement
233229 return $gen_name( ( !self . $conv_fn( ) ) . wrapping_add( 1 ) , false , f) ;
234230 }
235231 }
You can’t perform that action at this time.
0 commit comments