fix(lint): resolve clippy 1.98 lints - #442
Conversation
CI's stable clippy moved to 1.98, which added chunks_exact_to_as_chunks and manual_slice_fill; both fire on existing code, so every PR fails the Clippy job. Replace constant-size chunks_exact/chunks_exact_mut calls with as_chunks/as_chunks_mut and use slice::fill for the DP row init. No behavior change.
There was a problem hiding this comment.
No issues found across 7 files
Shadow auto-approve: would auto-approve. Replace chunks_exact with as_chunks and slice::fill to satisfy new clippy lints, with no behavior change.
Re-trigger cubic
CI previously installed whatever stable was current, so a new stable release could add clippy lints and break every open PR overnight (as 1.98 just did). Pin the toolchain in rust-toolchain.toml for local development and maturin builds, and pass the same version explicitly to dtolnay/rust-toolchain in the workflows (the action exports RUSTUP_TOOLCHAIN, which overrides the file). Bumps are now a deliberate PR: install the new version, fix new lints, update both places.
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
The '# stable' comment named the dtolnay/rust-toolchain action tag the SHA pins, but after pinning the toolchain input it read as if the Rust version were still floating stable.
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Shadow auto-approve: would require human review. Pins Rust toolchain to 1.98.0 in CI and locally; operational change needs human approval.
Re-trigger cubic
slice::as_chunks (introduced by the clippy 1.98 lint fixes) needs 1.88. Declaring it turns an opaque compile error on older toolchains into a clear version requirement, and lets MSRV-aware dependency resolution work for consumers. Verified: cargo +1.88.0 check passes.
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would require human review. Pins Rust toolchain to 1.98.0 in CI and adds rust-toolchain.toml for local development; operational decision needs human approval.
Re-trigger cubic
CI's stable clippy moved to 1.98, adding
chunks_exact_to_as_chunksandmanual_slice_fill. Both fire on existing code (8 sites in the default build, 4 more behind--features ocr), so the Clippy job currently fails on every PR.Changes
chunks_exact/chunks_exact_mutwithas_chunks::<N>/as_chunks_mut::<N>(UTF-16BE decoding in detector/fonts/text_utils/tounicode, RGB pixel handling in vision).slice::fillfor the DP row initialization indetect_struct.rust-toolchain.tomlcovers local development and maturin builds, and the workflows pass the same version explicitly (dtolnay/rust-toolchain exportsRUSTUP_TOOLCHAIN, which overrides the file, so both places are needed). Toolchain bumps become a deliberate PR: install, fix new lints, update both places.No behavior change:
as_chunks::<N>().0iterates exactly the chunkschunks_exact(N)yielded. Full-corpus A/B against a main-built binary is byte-identical.Testing
cargo clippy -- -D warningsandcargo clippy --features ocr -- -D warningspass on 1.98.0 (the OCR sites never surfaced in CI because the job fails on the first step).cargo fmt --checkandcargo test(987 unit + 163 integration) pass under the pinned toolchain.🤖 Generated with Claude Code