chore(zseri/store-ref-scanner): fix clippy warnings

Change-Id: I0e75feb501c56a98a73048443c36132308245945
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4597
Tested-by: BuildkiteCI
Reviewed-by: zseri <zseri.devel@ytrizja.de>
This commit is contained in:
zseri 2021-12-25 02:27:42 +01:00
parent 8cdda57580
commit 5f2b37bdb0
2 changed files with 6 additions and 17 deletions

View file

@ -1,6 +1,8 @@
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub struct HalfBytesMask(pub [u8; 16]);
// fires erronously
#[allow(clippy::zero_prefixed_literal)]
impl HalfBytesMask {
pub const B32_REVSHA256: HalfBytesMask =
HalfBytesMask([0, 0, 0, 0, 0, 0, 255, 3, 0, 0, 0, 0, 222, 127, 207, 7]);
@ -17,7 +19,7 @@ impl HalfBytesMask {
let mut tmp = 0;
let fin = idx * 8;
macro_rules! bitx {
($($a:expr),+) => {{ $( if x[fin + $a] { tmp += (1 << $a) as u8; } )+ }}
($($a:expr),+) => {{ $( if x[fin + $a] { tmp += (1 << $a) as u8; } )+ }}
}
bitx!(0, 1, 2, 3, 4, 5, 6, 7);
ret[idx] = tmp;
@ -63,7 +65,7 @@ impl HalfBytesMask {
return;
}
}
let mut block = &mut self.0[usize::from(byte / 8)];
let block = &mut self.0[usize::from(byte / 8)];
let bitpat = (1 << u32::from(byte % 8)) as u8;
if allow {
*block |= bitpat;