Skip to content

chore(lint): fix clippy 1.98 pedantic lints breaking every PR - #236

Merged
BenjaminDEMAILLE merged 1 commit into
mainfrom
chore/clippy-1.98
Aug 23, 2026
Merged

chore(lint): fix clippy 1.98 pedantic lints breaking every PR#236
BenjaminDEMAILLE merged 1 commit into
mainfrom
chore/clippy-1.98

Conversation

@BenjaminDEMAILLE

Copy link
Copy Markdown
Contributor

Why

main is red under the CI toolchain. Stable clippy 1.98 adds two pedantic lints that fire on existing code, and CI runs cargo clippy --all-targets -- -D warnings, so every PR opened today fails on files it never touched (seen on #235, a config-only change).

error: using `chunks_exact` with a constant chunk size
  --> src/align/simd_scan.rs:31:29
  --> src/align/simd_scan.rs:32:31
  --> src/bam_dedup.rs:317:49
error: manual implementation of `midpoint` which can overflow
  --> src/quant/mod.rs:323:27

Note for anyone who checked locally and saw nothing: cargo does not replay diagnostics for crates that are already fresh in the cache, so a warm-cache cargo clippy misses these. touch src/lib.rs first to reproduce.

What

  • simd_scan::find_stop: as_chunks::<16>() replaces chunks_exact(16) plus the two try_into().unwrap() casts; the tail comes from the same destructuring instead of .remainder().
  • bam_dedup: as_chunks::<2>() for the (mate1, mate2) pairing.
  • quant: usize::midpoint for the segment-tree split point.

Behaviour is identical: as_chunks yields the same chunks and remainder as chunks_exact, and midpoint equals (a + b) >> 1 for the non-overflowing indices here. The unsafe SIMD surface is untouched, and chunk_all_match now receives &[u8; 16] directly rather than through a checked cast.

MSRV 1.89 covers both APIs (as_chunks 1.88, usize::midpoint 1.85).

Verification

cargo clippy --all-targets -- -D warnings clean, cargo fmt --check clean, cargo test green (10 suites, 0 failures).

🤖 Generated with Claude Code

Stable clippy 1.98 adds chunks_exact_to_as_chunks and manual_midpoint, both
pedantic, both firing on existing code. CI runs clippy with -D warnings, so
every PR opened today fails on unrelated files.

- simd_scan::find_stop: as_chunks::<16>() instead of chunks_exact(16) plus
  try_into().unwrap(); the remainder now comes from the same destructuring.
- bam_dedup: as_chunks::<2>() for the (mate1, mate2) pairing.
- quant: usize::midpoint for the segment-tree split point.

Behaviour is unchanged: as_chunks yields the same chunks and remainder as
chunks_exact, and midpoint equals (a + b) >> 1 for the non-overflowing
indices here. MSRV 1.89 covers as_chunks (1.88) and usize::midpoint (1.85).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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