Fix CI: correct the Rust toolchain action and clear the lint backlog - #2
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three Rust jobs never ran a single line of code: they referenced
dtolnay/rust-action@stable, which does not exist. The action isdtolnay/rust-toolchain@stable.release.ymlhad the same typo.With the jobs able to start, the checks they run had to be made to pass.
What was broken
cargo fmt --checkcargo clippy -D warningscargo testNotable items
.max(a).min(b)chains became.clamp(a, b).verify()inecc.rsreturnedOk(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_addressreturns the offset from both branches. The branch is kept, with an explanation, because parts that address the OOB separately need a different mapping there.ecc.rskeep their index-based form; rewriting them as iterator chains would obscure the correspondence with the published algorithm.DevicePlatform::from_strcannot implementstd::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_u8asserted0xFFmaps to nothing. v3.0 assigned the whole0xF0-0xFFrange to the cloud commands, so0xFFisCloudStatus. The test now asserts that, and uses0xCF— still unassigned — for the negative case.Verified locally; CI itself cannot confirm this until the account billing lock is lifted.