@@ -308,13 +308,7 @@ impl FormattingOptions {
308
308
/// - no [`DebugAsHex`] output mode.
309
309
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
310
310
pub const fn new ( ) -> Self {
311
- Self {
312
- flags : 0 ,
313
- fill : ' ' ,
314
- align : None ,
315
- width : None ,
316
- precision : None ,
317
- }
311
+ Self { flags : 0 , fill : ' ' , align : None , width : None , precision : None }
318
312
}
319
313
320
314
/// Sets or removes the sign (the `+` or the `-` flag).
@@ -327,9 +321,10 @@ impl FormattingOptions {
327
321
/// - `-`: Currently not used
328
322
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
329
323
pub const fn sign ( & mut self , sign : Option < Sign > ) -> & mut Self {
330
- self . flags = self . flags & !( 1 << rt:: Flag :: SignMinus as u32 | 1 << rt:: Flag :: SignPlus as u32 ) ;
324
+ self . flags =
325
+ self . flags & !( 1 << rt:: Flag :: SignMinus as u32 | 1 << rt:: Flag :: SignPlus as u32 ) ;
331
326
match sign {
332
- None => { } ,
327
+ None => { }
333
328
Some ( Sign :: Plus ) => self . flags |= 1 << rt:: Flag :: SignPlus as u32 ,
334
329
Some ( Sign :: Minus ) => self . flags |= 1 << rt:: Flag :: SignMinus as u32 ,
335
330
}
@@ -413,9 +408,10 @@ impl FormattingOptions {
413
408
/// hexadecimal or normal integers
414
409
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
415
410
pub const fn debug_as_hex ( & mut self , debug_as_hex : Option < DebugAsHex > ) -> & mut Self {
416
- self . flags = self . flags & !( 1 << rt:: Flag :: DebugUpperHex as u32 | 1 << rt:: Flag :: DebugLowerHex as u32 ) ;
411
+ self . flags = self . flags
412
+ & !( 1 << rt:: Flag :: DebugUpperHex as u32 | 1 << rt:: Flag :: DebugLowerHex as u32 ) ;
417
413
match debug_as_hex {
418
- None => { } ,
414
+ None => { }
419
415
Some ( DebugAsHex :: Upper ) => self . flags |= 1 << rt:: Flag :: DebugUpperHex as u32 ,
420
416
Some ( DebugAsHex :: Lower ) => self . flags |= 1 << rt:: Flag :: DebugLowerHex as u32 ,
421
417
}
@@ -469,7 +465,9 @@ impl FormattingOptions {
469
465
pub const fn get_debug_as_hex ( & self ) -> Option < DebugAsHex > {
470
466
const DEBUG_UPPER_BITFIELD : u32 = 1 << rt:: Flag :: DebugUpperHex as u32 ;
471
467
const DEBUG_LOWER_BITFIELD : u32 = 1 << rt:: Flag :: DebugLowerHex as u32 ;
472
- match self . flags & ( ( 1 << rt:: Flag :: DebugUpperHex as u32 ) | ( 1 << rt:: Flag :: DebugLowerHex as u32 ) ) {
468
+ match self . flags
469
+ & ( ( 1 << rt:: Flag :: DebugUpperHex as u32 ) | ( 1 << rt:: Flag :: DebugLowerHex as u32 ) )
470
+ {
473
471
DEBUG_UPPER_BITFIELD => Some ( DebugAsHex :: Upper ) ,
474
472
DEBUG_LOWER_BITFIELD => Some ( DebugAsHex :: Lower ) ,
475
473
0 => None ,
0 commit comments