File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ impl Bit {
1919 let len = data. len ( ) ;
2020 let mut bytes = vec ! [ 0 ; ( len + 7 ) / 8 ] ;
2121 for ( i, v) in data. iter ( ) . enumerate ( ) {
22- bytes[ i / 8 ] |= ( * v as u8 ) << ( 7 - ( i % 8 ) ) ;
22+ bytes[ i / 8 ] |= u8 :: from ( * v) << ( 7 - ( i % 8 ) ) ;
2323 }
2424 Bit { len, data : bytes }
2525 }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ impl HalfVector {
3939 pub ( crate ) fn from_sql (
4040 buf : & [ u8 ] ,
4141 ) -> Result < HalfVector , Box < dyn std:: error:: Error + Sync + Send > > {
42- let dim = u16:: from_be_bytes ( buf[ 0 ..2 ] . try_into ( ) ?) as usize ;
42+ let dim = u16:: from_be_bytes ( buf[ 0 ..2 ] . try_into ( ) ?) . into ( ) ;
4343 let unused = u16:: from_be_bytes ( buf[ 2 ..4 ] . try_into ( ) ?) ;
4444 if unused != 0 {
4545 return Err ( "expected unused to be 0" . into ( ) ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl Vector {
4242
4343 #[ cfg( any( feature = "postgres" , feature = "sqlx" , feature = "diesel" ) ) ]
4444 pub ( crate ) fn from_sql ( buf : & [ u8 ] ) -> Result < Vector , Box < dyn std:: error:: Error + Sync + Send > > {
45- let dim = u16:: from_be_bytes ( buf[ 0 ..2 ] . try_into ( ) ?) as usize ;
45+ let dim = u16:: from_be_bytes ( buf[ 0 ..2 ] . try_into ( ) ?) . into ( ) ;
4646 let unused = u16:: from_be_bytes ( buf[ 2 ..4 ] . try_into ( ) ?) ;
4747 if unused != 0 {
4848 return Err ( "expected unused to be 0" . into ( ) ) ;
You can’t perform that action at this time.
0 commit comments