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 {
19
19
let len = data. len ( ) ;
20
20
let mut bytes = vec ! [ 0 ; ( len + 7 ) / 8 ] ;
21
21
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 ) ) ;
23
23
}
24
24
Bit { len, data : bytes }
25
25
}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ impl HalfVector {
39
39
pub ( crate ) fn from_sql (
40
40
buf : & [ u8 ] ,
41
41
) -> 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 ( ) ;
43
43
let unused = u16:: from_be_bytes ( buf[ 2 ..4 ] . try_into ( ) ?) ;
44
44
if unused != 0 {
45
45
return Err ( "expected unused to be 0" . into ( ) ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl Vector {
42
42
43
43
#[ cfg( any( feature = "postgres" , feature = "sqlx" , feature = "diesel" ) ) ]
44
44
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 ( ) ;
46
46
let unused = u16:: from_be_bytes ( buf[ 2 ..4 ] . try_into ( ) ?) ;
47
47
if unused != 0 {
48
48
return Err ( "expected unused to be 0" . into ( ) ) ;
You can’t perform that action at this time.
0 commit comments