Skip to content

Fix CI: correct the Rust toolchain action and clear the lint backlog - #2

Merged
bobberdolle1 merged 1 commit into
mainfrom
fix/ci-rust-action-and-lints
Jul 27, 2026
Merged

Fix CI: correct the Rust toolchain action and clear the lint backlog#2
bobberdolle1 merged 1 commit into
mainfrom
fix/ci-rust-action-and-lints

Conversation

@bobberdolle1

Copy link
Copy Markdown
Owner

The three Rust jobs never ran a single line of code: they referenced dtolnay/rust-action@stable, which does not exist. The action is dtolnay/rust-toolchain@stable. release.yml had the same typo.

With the jobs able to start, the checks they run had to be made to pass.

What was broken

Check Before After
Job startup fails resolving the action runs
cargo fmt --check drifted clean
cargo clippy -D warnings 38 errors clean
cargo test 1 failure / 225 225 pass + 2 doc-tests

Notable items

  • Three clamp-like .max(a).min(b) chains became .clamp(a, b).
  • verify() in ecc.rs returned Ok(0) from two separate branches for 0 and 1 bit errors; a single differing bit lies in the ECC bytes rather than the data either way, so they are now one condition.
  • calculate_column_address returns the offset from both branches. The branch is kept, with an explanation, because parts that address the OOB separately need a different mapping there.
  • The Galois-field loops in ecc.rs keep their index-based form; rewriting them as iterator chains would obscure the correspondence with the published algorithm.
  • DevicePlatform::from_str cannot implement std::str::FromStr — parsing is infallible and the name is public API — so the lint is allowed locally rather than the method renamed.

Real defect found

test_command_from_u8 asserted 0xFF maps to nothing. v3.0 assigned the whole 0xF0-0xFF range to the cloud commands, so 0xFF is CloudStatus. The test now asserts that, and uses 0xCF — still unassigned — for the negative case.

Verified locally; CI itself cannot confirm this until the account billing lock is lifted.

The three Rust jobs never ran a single line of code. They referenced
`dtolnay/rust-action@stable`, which does not exist - the action is
`dtolnay/rust-toolchain@stable` - so every job failed while resolving it.
release.yml carried the same typo.

With the jobs able to start, the checks they run had to be made to pass:

- `cargo fmt` applied; the formatting had drifted in cloud.rs and elsewhere.
- Clippy went from 38 errors to zero under `-D warnings`. Most were mechanical
  (`1 * 1024 * 1024`, a redundant `.into_iter()`) and were fixed by
  `clippy --fix`. The rest are addressed individually:
  - Three clamp-like `.max(a).min(b)` chains became `.clamp(a, b)`.
  - `verify()` in ecc.rs had two branches returning `Ok(0)` for 0 and 1 bit
    errors; they are now one condition, since a single differing bit is in the
    ECC bytes rather than the data either way.
  - `calculate_column_address` returns the offset from both branches. The
    branch is kept, with an explanation, because parts that address the OOB
    separately need a different mapping there.
  - The Galois-field loops in ecc.rs keep their index-based form; rewriting
    them as iterator chains would obscure the published algorithm.
  - `DevicePlatform::from_str` cannot be `std::str::FromStr` - parsing is
    infallible and the name is public API - so the lint is allowed locally.
  - Three never-read fields are marked, with a note on what would read them.

`test_command_from_u8` asserted that 0xFF maps to nothing. v3.0 assigned the
whole 0xF0-0xFF range to the cloud commands, so 0xFF is now CloudStatus. The
test asserts that, and uses 0xCF - still unassigned - for the negative case.

Verified locally: fmt --check clean, clippy -D warnings clean, 225 unit tests
and 2 doc-tests passing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bobberdolle1
bobberdolle1 merged commit 74bf05e into main Jul 27, 2026
1 of 6 checks passed
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