@@ -292,13 +292,7 @@ impl FormattingOptions {
292
292
/// - no [`DebugAsHex`] output mode.
293
293
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
294
294
pub const fn new ( ) -> Self {
295
- Self {
296
- flags : 0 ,
297
- fill : ' ' ,
298
- align : None ,
299
- width : None ,
300
- precision : None ,
301
- }
295
+ Self { flags : 0 , fill : ' ' , align : None , width : None , precision : None }
302
296
}
303
297
304
298
/// Sets or removes the sign (the `+` or the `-` flag).
@@ -311,9 +305,10 @@ impl FormattingOptions {
311
305
/// - `-`: Currently not used
312
306
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
313
307
pub const fn sign ( & mut self , sign : Option < Sign > ) -> & mut Self {
314
- self . flags = self . flags & !( 1 << rt:: Flag :: SignMinus as u32 | 1 << rt:: Flag :: SignPlus as u32 ) ;
308
+ self . flags =
309
+ self . flags & !( 1 << rt:: Flag :: SignMinus as u32 | 1 << rt:: Flag :: SignPlus as u32 ) ;
315
310
match sign {
316
- None => { } ,
311
+ None => { }
317
312
Some ( Sign :: Plus ) => self . flags |= 1 << rt:: Flag :: SignPlus as u32 ,
318
313
Some ( Sign :: Minus ) => self . flags |= 1 << rt:: Flag :: SignMinus as u32 ,
319
314
}
@@ -397,9 +392,10 @@ impl FormattingOptions {
397
392
/// hexadecimal or normal integers
398
393
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
399
394
pub const fn debug_as_hex ( & mut self , debug_as_hex : Option < DebugAsHex > ) -> & mut Self {
400
- self . flags = self . flags & !( 1 << rt:: Flag :: DebugUpperHex as u32 | 1 << rt:: Flag :: DebugLowerHex as u32 ) ;
395
+ self . flags = self . flags
396
+ & !( 1 << rt:: Flag :: DebugUpperHex as u32 | 1 << rt:: Flag :: DebugLowerHex as u32 ) ;
401
397
match debug_as_hex {
402
- None => { } ,
398
+ None => { }
403
399
Some ( DebugAsHex :: Upper ) => self . flags |= 1 << rt:: Flag :: DebugUpperHex as u32 ,
404
400
Some ( DebugAsHex :: Lower ) => self . flags |= 1 << rt:: Flag :: DebugLowerHex as u32 ,
405
401
}
@@ -453,7 +449,9 @@ impl FormattingOptions {
453
449
pub const fn get_debug_as_hex ( & self ) -> Option < DebugAsHex > {
454
450
const DEBUG_UPPER_BITFIELD : u32 = 1 << rt:: Flag :: DebugUpperHex as u32 ;
455
451
const DEBUG_LOWER_BITFIELD : u32 = 1 << rt:: Flag :: DebugLowerHex as u32 ;
456
- match self . flags & ( ( 1 << rt:: Flag :: DebugUpperHex as u32 ) | ( 1 << rt:: Flag :: DebugLowerHex as u32 ) ) {
452
+ match self . flags
453
+ & ( ( 1 << rt:: Flag :: DebugUpperHex as u32 ) | ( 1 << rt:: Flag :: DebugLowerHex as u32 ) )
454
+ {
457
455
DEBUG_UPPER_BITFIELD => Some ( DebugAsHex :: Upper ) ,
458
456
DEBUG_LOWER_BITFIELD => Some ( DebugAsHex :: Lower ) ,
459
457
0 => None ,
0 commit comments