@@ -280,14 +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 )
284- as u8 ;
283+ buf[ i] = ( ( self . data [ i / Self :: BYTE_UNIT ] >> ( ( i % Self :: BYTE_UNIT ) * 8 ) )
284+ & 0xff ) 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 )
289+ buf[ num_bytes - i - 1 ] = ( ( self . data [ i / Self :: BYTE_UNIT ]
290+ >> ( ( i % Self :: BYTE_UNIT ) * 8 ) )
291291 & 0xff ) as u8 ;
292292 }
293293 }
@@ -313,12 +313,12 @@ impl BitVector for Bvd {
313313 }
314314
315315 fn write < W : Write > ( & self , writer : & mut W , endianness : Endianness ) -> std:: io:: Result < ( ) > {
316- return writer. write_all ( self . to_vec ( endianness) . as_slice ( ) ) ;
316+ writer. write_all ( self . to_vec ( endianness) . as_slice ( ) )
317317 }
318318
319319 fn get ( & self , index : usize ) -> Bit {
320320 debug_assert ! ( index < self . length) ;
321- ( self . data [ index / Self :: BIT_UNIT ] >> ( index % Self :: BIT_UNIT ) & 1 ) . into ( )
321+ ( ( self . data [ index / Self :: BIT_UNIT ] >> ( index % Self :: BIT_UNIT ) ) & 1 ) . into ( )
322322 }
323323
324324 fn set ( & mut self , index : usize , bit : Bit ) {
@@ -446,15 +446,15 @@ impl BitVector for Bvd {
446446 fn shl_in ( & mut self , bit : Bit ) -> Bit {
447447 let mut carry = bit;
448448 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 ;
449+ let b = ( self . data [ i] >> ( Self :: BIT_UNIT - 1 ) ) & 1 ;
450+ self . data [ i] = ( self . data [ i] << 1 ) | carry as u64 ;
451451 carry = b. into ( ) ;
452452 }
453453 if self . length % Self :: BIT_UNIT != 0 {
454454 let i = self . length / Self :: BIT_UNIT ;
455- let b = self . data [ i] >> ( self . length % Self :: BIT_UNIT - 1 ) & 1 ;
455+ let b = ( self . data [ i] >> ( self . length % Self :: BIT_UNIT - 1 ) ) & 1 ;
456456 self . data [ i] =
457- ( self . data [ i] << 1 | carry as u64 ) & u64:: mask ( self . length % Self :: BIT_UNIT ) ;
457+ ( ( self . data [ i] << 1 ) | carry as u64 ) & u64:: mask ( self . length % Self :: BIT_UNIT ) ;
458458 carry = b. into ( ) ;
459459 }
460460 carry
@@ -465,12 +465,13 @@ impl BitVector for Bvd {
465465 if self . length % Self :: BIT_UNIT != 0 {
466466 let i = self . length / Self :: BIT_UNIT ;
467467 let b = self . data [ i] & 1 ;
468- self . data [ i] = self . data [ i] >> 1 | ( carry as u64 ) << ( self . length % Self :: BIT_UNIT - 1 ) ;
468+ self . data [ i] =
469+ ( self . data [ i] >> 1 ) | ( ( carry as u64 ) << ( self . length % Self :: BIT_UNIT - 1 ) ) ;
469470 carry = b. into ( ) ;
470471 }
471472 for i in ( 0 ..( self . length / Self :: BIT_UNIT ) ) . rev ( ) {
472473 let b = self . data [ i] & 1 ;
473- self . data [ i] = self . data [ i] >> 1 | ( carry as u64 ) << ( Self :: BIT_UNIT - 1 ) ;
474+ self . data [ i] = ( self . data [ i] >> 1 ) | ( ( carry as u64 ) << ( Self :: BIT_UNIT - 1 ) ) ;
474475 carry = b. into ( ) ;
475476 }
476477 carry
@@ -725,7 +726,7 @@ impl fmt::Octal for Bvd {
725726 while let Some ( b0) = it. next ( ) {
726727 let b1 = it. next ( ) . unwrap_or ( Bit :: Zero ) ;
727728 let b2 = it. next ( ) . unwrap_or ( Bit :: Zero ) ;
728- let octet = ( b2 as u8 ) << 2 | ( b1 as u8 ) << 1 | b0 as u8 ;
729+ let octet = ( ( b2 as u8 ) << 2 ) | ( ( b1 as u8 ) << 1 ) | b0 as u8 ;
729730 if octet != 0 {
730731 last_nz = s. len ( ) ;
731732 }
0 commit comments