@@ -180,7 +180,7 @@ impl<'a> Tape<'a> {
180180 TapeElement :: Null => out. push_str ( "null" ) ,
181181 TapeElement :: I64 ( high) => match self . get ( idx + 1 ) {
182182 TapeElement :: I32 ( low) => {
183- let val = ( high as i64 ) << 32 | ( low as u32 ) as i64 ;
183+ let val = ( ( high as i64 ) << 32 ) | ( low as u32 ) as i64 ;
184184 let _ = write ! ( out, "{val}" ) ;
185185 return idx + 2 ;
186186 }
@@ -191,7 +191,7 @@ impl<'a> Tape<'a> {
191191 }
192192 TapeElement :: F64 ( high) => match self . get ( idx + 1 ) {
193193 TapeElement :: F32 ( low) => {
194- let val = f64:: from_bits ( ( high as u64 ) << 32 | low as u64 ) ;
194+ let val = f64:: from_bits ( ( ( high as u64 ) << 32 ) | low as u64 ) ;
195195 let _ = write ! ( out, "{val}" ) ;
196196 return idx + 2 ;
197197 }
@@ -491,7 +491,7 @@ impl TapeDecoder {
491491 // Parse a unicode escape sequence
492492 DecoderState :: Unicode ( high, low, idx) => loop {
493493 match * idx {
494- 0 ..=3 => * high = * high << 4 | parse_hex ( next ! ( iter) ) ? as u16 ,
494+ 0 ..=3 => * high = ( * high << 4 ) | parse_hex ( next ! ( iter) ) ? as u16 ,
495495 4 => {
496496 if let Some ( c) = char:: from_u32 ( * high as u32 ) {
497497 write_char ( c, & mut self . bytes ) ;
@@ -508,7 +508,7 @@ impl TapeDecoder {
508508 b'u' => { }
509509 b => return Err ( err ( b, "parsing surrogate pair unicode" ) ) ,
510510 } ,
511- 6 ..=9 => * low = * low << 4 | parse_hex ( next ! ( iter) ) ? as u16 ,
511+ 6 ..=9 => * low = ( * low << 4 ) | parse_hex ( next ! ( iter) ) ? as u16 ,
512512 _ => {
513513 let c = char_from_surrogate_pair ( * low, * high) ?;
514514 write_char ( c, & mut self . bytes ) ;
@@ -683,7 +683,7 @@ fn err(b: u8, ctx: &str) -> ArrowError {
683683
684684/// Creates a character from an UTF-16 surrogate pair
685685fn char_from_surrogate_pair ( low : u16 , high : u16 ) -> Result < char , ArrowError > {
686- let n = ( ( ( high - 0xD800 ) as u32 ) << 10 | ( low - 0xDC00 ) as u32 ) + 0x1_0000 ;
686+ let n = ( ( ( high - 0xD800 ) as u32 ) << 10 ) | ( ( low - 0xDC00 ) as u32 + 0x1_0000 ) ;
687687 char:: from_u32 ( n)
688688 . ok_or_else ( || ArrowError :: JsonError ( format ! ( "Invalid UTF-16 surrogate pair {n}" ) ) )
689689}
0 commit comments