File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -108,16 +108,15 @@ impl VInt {
108
108
}
109
109
110
110
let octet_length = ( Self :: MAX_OCTET_LENGTH as u32 ) - start. ilog2 ( ) ;
111
- dbg ! ( octet_length) ;
112
111
if octet_length > 8 || octet_length as u8 > max_length {
113
112
err ! ( BadVintSize ) ;
114
113
}
115
114
116
115
let mut bytes_read = 1 ;
117
- let mut val = start as u64 ^ ( 1 << start. ilog2 ( ) ) as u64 ;
116
+ let mut val = u64:: from ( start ) ^ ( 1 << start. ilog2 ( ) ) as u64 ;
118
117
while bytes_read < octet_length {
119
118
bytes_read += 1 ;
120
- val = ( val << 8 ) | reader. read_u8 ( ) ? as u64 ;
119
+ val = ( val << 8 ) | u64 :: from ( reader. read_u8 ( ) ?) ;
121
120
}
122
121
123
122
Ok ( Self ( val) )
@@ -196,7 +195,7 @@ impl VInt {
196
195
let mut val = self . value ( ) ;
197
196
198
197
// Add the octet length
199
- val |= 1 << octets * ( Self :: USABLE_BITS_PER_BYTE as u8 ) ;
198
+ val |= 1 << ( octets * ( Self :: USABLE_BITS_PER_BYTE as u8 ) ) ;
200
199
201
200
let mut byte_shift = ( octets - 1 ) as i8 ;
202
201
while byte_shift >= 0 {
You can’t perform that action at this time.
0 commit comments