@@ -280,15 +280,14 @@ impl BitVector for Bvd {
280280 match endianness {
281281 Endianness :: Little => {
282282 for i in 0 ..num_bytes {
283- buf[ i] = ( self . data [ i / Self :: BYTE_UNIT ] >> ( ( i % Self :: BYTE_UNIT ) * 8 ) & 0xff )
283+ buf[ i] = ( ( self . data [ i / Self :: BYTE_UNIT ] >> ( ( i % Self :: BYTE_UNIT ) * 8 ) ) & 0xff )
284284 as u8 ;
285285 }
286286 }
287287 Endianness :: Big => {
288288 for i in 0 ..num_bytes {
289- buf[ num_bytes - i - 1 ] = ( self . data [ i / Self :: BYTE_UNIT ]
290- >> ( ( i % Self :: BYTE_UNIT ) * 8 )
291- & 0xff ) as u8 ;
289+ buf[ num_bytes - i - 1 ] = ( ( self . data [ i / Self :: BYTE_UNIT ]
290+ >> ( ( i % Self :: BYTE_UNIT ) * 8 ) ) & 0xff ) as u8 ;
292291 }
293292 }
294293 }
@@ -313,12 +312,12 @@ impl BitVector for Bvd {
313312 }
314313
315314 fn write < W : Write > ( & self , writer : & mut W , endianness : Endianness ) -> std:: io:: Result < ( ) > {
316- return writer. write_all ( self . to_vec ( endianness) . as_slice ( ) ) ;
315+ writer. write_all ( self . to_vec ( endianness) . as_slice ( ) )
317316 }
318317
319318 fn get ( & self , index : usize ) -> Bit {
320319 debug_assert ! ( index < self . length) ;
321- ( self . data [ index / Self :: BIT_UNIT ] >> ( index % Self :: BIT_UNIT ) & 1 ) . into ( )
320+ ( ( self . data [ index / Self :: BIT_UNIT ] >> ( index % Self :: BIT_UNIT ) ) & 1 ) . into ( )
322321 }
323322
324323 fn set ( & mut self , index : usize , bit : Bit ) {
@@ -446,15 +445,15 @@ impl BitVector for Bvd {
446445 fn shl_in ( & mut self , bit : Bit ) -> Bit {
447446 let mut carry = bit;
448447 for i in 0 ..( self . length / Self :: BIT_UNIT ) {
449- let b = self . data [ i] >> ( Self :: BIT_UNIT - 1 ) & 1 ;
450- self . data [ i] = self . data [ i] << 1 | carry as u64 ;
448+ let b = ( self . data [ i] >> ( Self :: BIT_UNIT - 1 ) ) & 1 ;
449+ self . data [ i] = ( self . data [ i] << 1 ) | carry as u64 ;
451450 carry = b. into ( ) ;
452451 }
453452 if self . length % Self :: BIT_UNIT != 0 {
454453 let i = self . length / Self :: BIT_UNIT ;
455- let b = self . data [ i] >> ( self . length % Self :: BIT_UNIT - 1 ) & 1 ;
454+ let b = ( self . data [ i] >> ( self . length % Self :: BIT_UNIT - 1 ) ) & 1 ;
456455 self . data [ i] =
457- ( self . data [ i] << 1 | carry as u64 ) & u64:: mask ( self . length % Self :: BIT_UNIT ) ;
456+ ( ( self . data [ i] << 1 ) | carry as u64 ) & u64:: mask ( self . length % Self :: BIT_UNIT ) ;
458457 carry = b. into ( ) ;
459458 }
460459 carry
@@ -465,12 +464,12 @@ impl BitVector for Bvd {
465464 if self . length % Self :: BIT_UNIT != 0 {
466465 let i = self . length / Self :: BIT_UNIT ;
467466 let b = self . data [ i] & 1 ;
468- self . data [ i] = self . data [ i] >> 1 | ( carry as u64 ) << ( self . length % Self :: BIT_UNIT - 1 ) ;
467+ self . data [ i] = ( self . data [ i] >> 1 ) | ( ( carry as u64 ) << ( self . length % Self :: BIT_UNIT - 1 ) ) ;
469468 carry = b. into ( ) ;
470469 }
471470 for i in ( 0 ..( self . length / Self :: BIT_UNIT ) ) . rev ( ) {
472471 let b = self . data [ i] & 1 ;
473- self . data [ i] = self . data [ i] >> 1 | ( carry as u64 ) << ( Self :: BIT_UNIT - 1 ) ;
472+ self . data [ i] = ( self . data [ i] >> 1 ) | ( ( carry as u64 ) << ( Self :: BIT_UNIT - 1 ) ) ;
474473 carry = b. into ( ) ;
475474 }
476475 carry
@@ -725,7 +724,7 @@ impl fmt::Octal for Bvd {
725724 while let Some ( b0) = it. next ( ) {
726725 let b1 = it. next ( ) . unwrap_or ( Bit :: Zero ) ;
727726 let b2 = it. next ( ) . unwrap_or ( Bit :: Zero ) ;
728- let octet = ( b2 as u8 ) << 2 | ( b1 as u8 ) << 1 | b0 as u8 ;
727+ let octet = ( ( b2 as u8 ) << 2 ) | ( ( b1 as u8 ) << 1 ) | b0 as u8 ;
729728 if octet != 0 {
730729 last_nz = s. len ( ) ;
731730 }
0 commit comments