chore: walk the device bundle in fixed-size chunks

Stable clippy rejects `chunks_exact` with a constant size in favour of `as_chunks`, which fails the lint job for the whole workspace, and reading fixed arrays out of the slice drops the length check the old code carried as an `expect`.
This commit is contained in:
osmaczko
2026-08-21 09:25:20 +02:00
parent 233f50195f
commit cd9e9fe344
+5 -5
View File
@@ -156,12 +156,12 @@ pub fn decode_bundle_payload(payload: &[u8]) -> Result<DecodedBundle, BundleErro
if body.len() != count * 32 {
return Err(BundleError::Short);
}
let devices = body
.chunks_exact(32)
.map(|c| c.try_into().expect("chunks_exact(32) yields 32 bytes"))
.collect();
let (devices, _) = body.as_chunks::<32>();
Ok(DecodedBundle { lamport, devices })
Ok(DecodedBundle {
lamport,
devices: devices.to_vec(),
})
}
/// Decode `bundle`, confirm it belongs to `expected_account`, and verify the