Skip to content

Commit 66e0002

Browse files
committed
Clippy
1 parent 4de469d commit 66e0002

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ebml/vint.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,15 @@ impl VInt {
108108
}
109109

110110
let octet_length = (Self::MAX_OCTET_LENGTH as u32) - start.ilog2();
111-
dbg!(octet_length);
112111
if octet_length > 8 || octet_length as u8 > max_length {
113112
err!(BadVintSize);
114113
}
115114

116115
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;
118117
while bytes_read < octet_length {
119118
bytes_read += 1;
120-
val = (val << 8) | reader.read_u8()? as u64;
119+
val = (val << 8) | u64::from(reader.read_u8()?);
121120
}
122121

123122
Ok(Self(val))
@@ -196,7 +195,7 @@ impl VInt {
196195
let mut val = self.value();
197196

198197
// 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));
200199

201200
let mut byte_shift = (octets - 1) as i8;
202201
while byte_shift >= 0 {

0 commit comments

Comments
 (0)