chore: fix new clippy lints

This commit is contained in:
Mayeul@Zama
2025-02-05 14:34:42 +01:00
committed by mayeul-zama
parent 225b5b2597
commit f74f3903e0
32 changed files with 60 additions and 59 deletions

View File

@@ -146,8 +146,7 @@ fn build_branches(
build_branches(
content,
&(RegExpr::Seq {
re_xs: std::iter::repeat(*repeat_re.clone())
.take(std::cmp::max(1, at_least))
re_xs: std::iter::repeat_n(*repeat_re.clone(), std::cmp::max(1, at_least))
.collect(),
}),
c_pos,

View File

@@ -294,7 +294,10 @@ fn encrypt_data<T: AsRef<[u8]>>(input: T, client_key: Option<&ClientKey>) -> Vec
.iter()
.copied()
.chain(iter::once(0x80))
.chain(iter::repeat(0x00).take(if remainder == 0 { 0 } else { 64 - remainder }))
.chain(std::iter::repeat_n(
0x00,
if remainder == 0 { 0 } else { 64 - remainder },
))
.chain(((len * 8) as u64).to_be_bytes());
ArrayChunks::<_, 4>::new(bytes_iter)

View File

@@ -41,7 +41,7 @@ fn pad_sha256_data(data: &[u8]) -> Vec<bool> {
// Calculate the number of padding zeros required
let padding_zeros = (512 - ((bits.len() + 64) % 512)) % 512;
bits.extend(std::iter::repeat(false).take(padding_zeros));
bits.extend(std::iter::repeat_n(false, padding_zeros));
// Append a 64-bit big-endian representation of the original message length
let data_len_bits = (data.len() as u64) * 8;