@@ -265,12 +265,12 @@ impl EisaName {
265265
266266 let data = name. as_bytes ( ) ;
267267
268- let value: u32 = ( u32:: from ( data[ 0 ] - 0x40 ) << 26
269- | u32:: from ( data[ 1 ] - 0x40 ) << 21
270- | u32:: from ( data[ 2 ] - 0x40 ) << 16
271- | name. chars ( ) . nth ( 3 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) << 12
272- | name. chars ( ) . nth ( 4 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) << 8
273- | name. chars ( ) . nth ( 5 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) << 4
268+ let value: u32 = ( ( u32:: from ( data[ 0 ] - 0x40 ) << 26 )
269+ | ( u32:: from ( data[ 1 ] - 0x40 ) << 21 )
270+ | ( u32:: from ( data[ 2 ] - 0x40 ) << 16 )
271+ | ( name. chars ( ) . nth ( 3 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) << 12 )
272+ | ( name. chars ( ) . nth ( 4 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) << 8 )
273+ | ( name. chars ( ) . nth ( 5 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) << 4 )
274274 | name. chars ( ) . nth ( 6 ) . unwrap ( ) . to_digit ( 16 ) . unwrap ( ) )
275275 . swap_bytes ( ) ;
276276
@@ -439,7 +439,7 @@ where
439439 r#type : AddressSpaceType :: Memory ,
440440 min,
441441 max,
442- type_flags : ( cacheable as u8 ) << 1 | u8:: from ( read_write) ,
442+ type_flags : ( ( cacheable as u8 ) << 1 ) | u8:: from ( read_write) ,
443443 } )
444444 }
445445
@@ -471,7 +471,7 @@ where
471471 bytes. push ( descriptor) ; // Word Address Space Descriptor
472472 bytes. extend_from_slice ( & ( TryInto :: < u16 > :: try_into ( length) . unwrap ( ) ) . to_le_bytes ( ) ) ;
473473 bytes. push ( self . r#type as u8 ) ; // type
474- let generic_flags = 1 << 2 /* Min Fixed */ | 1 << 3 ; // Max Fixed
474+ let generic_flags = ( 1 << 2 ) /* Min Fixed */ | ( 1 << 3 ) ; // Max Fixed
475475 bytes. push ( generic_flags) ;
476476 bytes. push ( self . type_flags ) ;
477477 }
@@ -591,9 +591,9 @@ impl Aml for Interrupt {
591591 fn append_aml_bytes ( & self , bytes : & mut Vec < u8 > ) -> Result < ( ) , AmlError > {
592592 bytes. push ( 0x89 ) ; // Extended IRQ Descriptor
593593 bytes. extend_from_slice ( & 6u16 . to_le_bytes ( ) ) ;
594- let flags = u8:: from ( self . shared ) << 3
595- | u8:: from ( self . active_low ) << 2
596- | u8:: from ( self . edge_triggered ) << 1
594+ let flags = ( u8:: from ( self . shared ) << 3 )
595+ | ( u8:: from ( self . active_low ) << 2 )
596+ | ( u8:: from ( self . edge_triggered ) << 1 )
597597 | u8:: from ( self . consumer ) ;
598598 bytes. push ( flags) ;
599599 bytes. push ( 1u8 ) ; // count
@@ -682,7 +682,7 @@ impl Aml for Method<'_> {
682682 fn append_aml_bytes ( & self , bytes : & mut Vec < u8 > ) -> Result < ( ) , AmlError > {
683683 let mut tmp = Vec :: new ( ) ;
684684 self . path . append_aml_bytes ( & mut tmp) ?;
685- let flags: u8 = ( self . args & 0x7 ) | u8:: from ( self . serialized ) << 3 ;
685+ let flags: u8 = ( self . args & 0x7 ) | ( u8:: from ( self . serialized ) << 3 ) ;
686686 tmp. push ( flags) ;
687687 for child in & self . children {
688688 child. append_aml_bytes ( & mut tmp) ?;
@@ -766,7 +766,7 @@ impl Aml for Field {
766766 let mut tmp = Vec :: new ( ) ;
767767 self . path . append_aml_bytes ( & mut tmp) ?;
768768
769- let flags: u8 = self . access_type as u8 | ( self . update_rule as u8 ) << 5 ;
769+ let flags: u8 = self . access_type as u8 | ( ( self . update_rule as u8 ) << 5 ) ;
770770 tmp. push ( flags) ;
771771
772772 for field in self . fields . iter ( ) {
@@ -1263,15 +1263,17 @@ mod tests {
12631263 assert_eq ! (
12641264 Scope :: new(
12651265 "_SB_.MBRD" . try_into( ) . unwrap( ) ,
1266- vec![ & Name :: new(
1267- "_CRS" . try_into( ) . unwrap( ) ,
1268- & ResourceTemplate :: new( vec![ & Memory32Fixed :: new(
1269- true ,
1270- 0xE800_0000 ,
1271- 0x1000_0000
1272- ) ] )
1273- )
1274- . unwrap( ) ]
1266+ vec![
1267+ & Name :: new(
1268+ "_CRS" . try_into( ) . unwrap( ) ,
1269+ & ResourceTemplate :: new( vec![ & Memory32Fixed :: new(
1270+ true ,
1271+ 0xE800_0000 ,
1272+ 0x1000_0000
1273+ ) ] )
1274+ )
1275+ . unwrap( )
1276+ ]
12751277 )
12761278 . to_aml_bytes( )
12771279 . unwrap( ) ,
@@ -1438,13 +1440,15 @@ mod tests {
14381440 assert_eq ! (
14391441 Name :: new(
14401442 "_CRS" . try_into( ) . unwrap( ) ,
1441- & ResourceTemplate :: new( vec![ & AddressSpace :: new_memory(
1442- AddressSpaceCacheable :: Cacheable ,
1443- true ,
1444- 0x8_0000_0000u64 ,
1445- 0xf_ffff_ffffu64
1446- )
1447- . unwrap( ) ] )
1443+ & ResourceTemplate :: new( vec![
1444+ & AddressSpace :: new_memory(
1445+ AddressSpaceCacheable :: Cacheable ,
1446+ true ,
1447+ 0x8_0000_0000u64 ,
1448+ 0xf_ffff_ffffu64
1449+ )
1450+ . unwrap( )
1451+ ] )
14481452 )
14491453 . unwrap( )
14501454 . to_aml_bytes( )
@@ -1491,12 +1495,12 @@ mod tests {
14911495 assert_eq ! ( create_pkg_length( & [ 0u8 ; 62 ] , true ) , vec![ 63 ] ) ;
14921496 assert_eq ! (
14931497 create_pkg_length( & [ 0u8 ; 64 ] , true ) ,
1494- vec![ 1 << 6 | ( 66 & 0xf ) , 66 >> 4 ]
1498+ vec![ ( 1 << 6 ) | ( 66 & 0xf ) , 66 >> 4 ]
14951499 ) ;
14961500 assert_eq ! (
14971501 create_pkg_length( & [ 0u8 ; 4096 ] , true ) ,
14981502 vec![
1499- 2 << 6 | ( 4099 & 0xf ) as u8 ,
1503+ ( 2 << 6 ) | ( 4099 & 0xf ) as u8 ,
15001504 ( ( 4099 >> 4 ) & 0xff ) . try_into( ) . unwrap( ) ,
15011505 ( ( 4099 >> 12 ) & 0xff ) . try_into( ) . unwrap( )
15021506 ]
@@ -1553,7 +1557,9 @@ mod tests {
15531557 ( & "_SB_.PCI0._HID" . try_into( ) . unwrap( ) as & Path )
15541558 . to_aml_bytes( )
15551559 . unwrap( ) ,
1556- [ 0x2F , 0x03 , 0x5F , 0x53 , 0x42 , 0x5F , 0x50 , 0x43 , 0x49 , 0x30 , 0x5F , 0x48 , 0x49 , 0x44 ]
1560+ [
1561+ 0x2F , 0x03 , 0x5F , 0x53 , 0x42 , 0x5F , 0x50 , 0x43 , 0x49 , 0x30 , 0x5F , 0x48 , 0x49 , 0x44
1562+ ]
15571563 ) ;
15581564 }
15591565
@@ -2007,13 +2013,15 @@ mod tests {
20072013 vec![
20082014 & Name :: new(
20092015 "MR64" . try_into( ) . unwrap( ) ,
2010- & ResourceTemplate :: new( vec![ & AddressSpace :: new_memory(
2011- AddressSpaceCacheable :: Cacheable ,
2012- true ,
2013- 0x0000_0000_0000_0000u64 ,
2014- 0xFFFF_FFFF_FFFF_FFFEu64
2015- )
2016- . unwrap( ) ] )
2016+ & ResourceTemplate :: new( vec![
2017+ & AddressSpace :: new_memory(
2018+ AddressSpaceCacheable :: Cacheable ,
2019+ true ,
2020+ 0x0000_0000_0000_0000u64 ,
2021+ 0xFFFF_FFFF_FFFF_FFFEu64
2022+ )
2023+ . unwrap( )
2024+ ] )
20172025 )
20182026 . unwrap( ) ,
20192027 & CreateField :: <u64 >:: new(
0 commit comments