Skip to content

Commit c1425b6

Browse files
authored
fix(lint): clippy manual_clear + rustfmt drift in lz4, red on main since #76 (#83)
#76's own arm lane failed on exactly these and merged anyway; every branch merging main inherits the red. dst.truncate(0) -> dst.clear() (same semantics), and the fmt wrap at the test pattern loop. Full workspace clippy --all-targets -D warnings + fmt --check green locally.
1 parent b842278 commit c1425b6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crate/src/lz4.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn decompress(src: &[u8], dst_size: usize) -> Result<Vec<u8>, Lz4Error> {
6161

6262
if slen == 0 {
6363
if dst_size == 0 {
64-
dst.truncate(0);
64+
dst.clear();
6565
return Ok(dst);
6666
}
6767
return Err(Lz4Error::Malformed("empty input but non-zero output"));
@@ -1334,7 +1334,9 @@ mod hc_kernel_tests {
13341334
for period in [1usize, 2, 3, 4, 5, 6, 7, 8, 11, 16] {
13351335
let mut v = vec![0u8; 96 * 1024];
13361336
for (i, b) in v.iter_mut().enumerate() {
1337-
*b = ((i % period) as u8).wrapping_mul(37).wrapping_add(period as u8);
1337+
*b = ((i % period) as u8)
1338+
.wrapping_mul(37)
1339+
.wrapping_add(period as u8);
13381340
}
13391341
// A few aperiodic bytes so matches end mid-word too.
13401342
v[1000] ^= 0x5A;

0 commit comments

Comments
 (0)