Skip to content

fix(lint): resolve clippy 1.98 lints - #442

Merged
abimaelmartell merged 4 commits into
mainfrom
fix/clippy-198-lints
Aug 20, 2026
Merged

abimaelmartell merged 4 commits into
mainfrom
fix/clippy-198-lints

Conversation

@abimaelmartell

@abimaelmartell abimaelmartell commented Aug 20, 2026

Copy link
Copy Markdown
Member

CI's stable clippy moved to 1.98, adding chunks_exact_to_as_chunks and manual_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

  • Replace constant-size chunks_exact/chunks_exact_mut with as_chunks::<N>/as_chunks_mut::<N> (UTF-16BE decoding in detector/fonts/text_utils/tounicode, RGB pixel handling in vision).
  • Use slice::fill for the DP row initialization in detect_struct.
  • Pin the toolchain to 1.98.0 so the next stable release can't break every open PR again: rust-toolchain.toml covers local development and maturin builds, and the workflows pass the same version explicitly (dtolnay/rust-toolchain exports RUSTUP_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>().0 iterates exactly the chunks chunks_exact(N) yielded. Full-corpus A/B against a main-built binary is byte-identical.

Testing

  • cargo clippy -- -D warnings and cargo clippy --features ocr -- -D warnings pass on 1.98.0 (the OCR sites never surfaced in CI because the job fails on the first step).
  • cargo fmt --check and cargo test (987 unit + 163 integration) pass under the pinned toolchain.

🤖 Generated with Claude Code

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread .github/workflows/ci.yml
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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@abimaelmartell
abimaelmartell merged commit 0631789 into main Aug 20, 2026
11 checks passed
@abimaelmartell
abimaelmartell deleted the fix/clippy-198-lints branch August 20, 2026 21:09
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