Skip to content

fix(lints): satisfy the new Rust 1.98 clippy lints - #128

Merged
MagicalTux merged 1 commit into
masterfrom
fix/rust-198-lints
Sep 4, 2026
Merged

fix(lints): satisfy the new Rust 1.98 clippy lints#128
MagicalTux merged 1 commit into
masterfrom
fix/rust-198-lints

Conversation

@MagicalTux

Copy link
Copy Markdown
Member

GitHub's runners moved to rustc 1.98.1 and CI runs clippy with -D warnings, so four lints new in 1.98 now fail Test & lint on all three OSes plus Clippy on a narrow feature subset — on master, unrelated to any pending change. Confirmed pre-existing by running clippy against clean HEAD; #127 hit them and is blocked behind this.

lint site fix
chunks_exact_to_as_chunks src/checksum.rs (CRC-32 slice-by-8) as_chunks::<8>()
chunks_exact_to_as_chunks src/zstd/xxhash.rs (32-byte stripes) as_chunks::<32>()
manual_slice_fill src/rar5/decoder.rs reset window.fill(0)
needless_late_init src/rangecoder/mod.rs tree decode bind bit from the if/else

as_chunks returns the fixed-size chunks and the remainder as a pair, replacing the iterator plus .remainder(). It is stable since 1.88, which is exactly this crate's rust-version, so the MSRV floor is unchanged — verified with a cargo +1.88 build --all-features.

All four are mechanical with no behaviour change. The two checksum inner loops are the ones worth care, so beyond the full suite they are covered by the CRC-32 catalogue vectors (0xCBF43926), the chunked-vs-one-shot equality test, and the gzip/zstd round-trips that drive CRC-32 and xxhash end to end.

cargo test --all-features: 1766 pass, 0 fail. Clippy clean under --all-features and both narrow-subset commands CI runs (--features lz4, --features zstd). fmt clean.

Worth considering separately: nothing pins the toolchain, so dtolnay/rust-toolchain@stable will keep importing new lints the day they ship. A pinned toolchain (or a scheduled canary job) would turn that into a deliberate upgrade rather than a surprise red master.

GitHub's runners moved to rustc 1.98.1 and CI runs clippy with `-D warnings`,
so four lints new in 1.98 now fail every job on master — unrelated to any
pending change. Verified pre-existing by running clippy against clean HEAD.

- `chunks_exact_to_as_chunks` in checksum.rs (CRC-32 slice-by-8) and
  zstd/xxhash.rs (32-byte stripes): switch to `as_chunks::<N>()`, which
  returns the fixed-size chunks and the remainder as a pair. Stable since
  1.88, which is this crate's MSRV — verified with a 1.88 build.
- `manual_slice_fill` in rar5's reset: `window.fill(0)`.
- `needless_late_init` in the rangecoder tree decode: bind `bit` from the
  `if`/`else` directly.

All four are mechanical; no behaviour change. The two checksum inner loops
are the ones worth being careful about, so beyond the full suite they are
covered by the CRC-32 catalogue vectors, the chunked-vs-one-shot equality
test, and the gzip/zstd round-trips that exercise CRC-32 and xxhash end to
end. `cargo test --all-features`: 1766 pass, 0 fail. Clippy clean under
`--all-features` and both narrow subsets CI checks (`lz4`-only, `zstd`-only).
@MagicalTux
MagicalTux merged commit 28c7141 into master Sep 4, 2026
46 checks passed
@MagicalTux
MagicalTux deleted the fix/rust-198-lints branch September 4, 2026 03:26
@MagicalTux MagicalTux mentioned this pull request Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant