clippy: the workspace passes clippy with -D warnings again #265

Merged
Cannnabis merged 1 commit from upstream-pr/265 into main 2026-11-29 08:17:00 +00:00
Cannnabis commented 2026-11-27 20:19:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Cannnabis on 2026-11-27T20:19:02Z.


What this fixes

The CI's clippy step (cargo clippy --workspace --all-targets --locked -- -D warnings) fails on main today: about 28 warnings in victory-gpu and one in victory. Nothing has run Actions here yet, so it has gone unseen. This brings the workspace to zero, mechanically and without behavior changes:

  • 14 x is_multiple_of where % n == 0 was spelled by hand; the operator-precedence parentheses that came with them (dstorage.rs, texture.rs of both crates, land/tests.rs).
  • 3 x hex literals grouped (port.rs, queue.rs — the values are the same).
  • sort_unstable_by(|a, b| b.2.cmp(&a.2)) → sort_unstable_by_key(|a| Reverse(...)) in descriptor/host.rs and draw.rs; needless borrows in draw.rs and resource.rs; drop of a Copy in pipeline/known.rs (the insert still happens); contains_key instead of get(..).is_none() in xmem.rs's tests.
  • The transmutes of write_sites.rs keep their shape and carry the why in their SAFETY comments (committed executable pages, the width of a code address, the calling convention kept); the lint needs an attribute to be silenced, and the tests' bindings already name the function type.
  • What only diagnostics or tests use is allowed dead where it stands, the way pipeline.rs and shadow.rs already do (#[cfg_attr(not(feature = "diagnostics"), allow(dead_code))]): host/indirects.rs whole, placed_filler_twins, Touch::Title. I checked each first — all are referenced behind the diagnostics cfg or by tests; deleting would have broken those builds.
  • The three shape lints (piece_at's eight arguments, from_level's convention, enum Late's variant size) carry #[allow(clippy::...)] with a one-line reason, as record_clamp_as already does. indirect.rs gets one attribute-only line (Rig.depth_written, written only; the tests clear through their own handle) — without it --all-targets cannot reach zero.

Verification

cargo clippy --workspace --all-targets --locked -- -D warnings: exit 0, zero warnings.

cargo test --workspace --locked --no-fail-fast: 1055 passed, 2 failed — the same two GPU-dependent indirect tests as on main here (issue #211, an RTX 4060 Ti; not from this change). No new failures anywhere.

Environment

Windows 11, RTX 4060 Ti, Rust 1.98.1 (pinned).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5532599416 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/265). Originally posted by [Cannnabis](https://github.com/Cannnabis) on 2026-11-27T20:19:02Z. --- ## What this fixes The CI's clippy step (`cargo clippy --workspace --all-targets --locked -- -D warnings`) fails on main today: about 28 warnings in `victory-gpu` and one in `victory`. Nothing has run Actions here yet, so it has gone unseen. This brings the workspace to zero, mechanically and without behavior changes: - 14 x `is_multiple_of` where `% n == 0` was spelled by hand; the operator-precedence parentheses that came with them (`dstorage.rs`, `texture.rs` of both crates, `land/tests.rs`). - 3 x hex literals grouped (`port.rs`, `queue.rs` — the values are the same). - `sort_unstable_by(|a, b| b.2.cmp(&a.2))` → `sort_unstable_by_key(|a| Reverse(...))` in `descriptor/host.rs` and `draw.rs`; needless borrows in `draw.rs` and `resource.rs`; `drop` of a `Copy` in `pipeline/known.rs` (the `insert` still happens); `contains_key` instead of `get(..).is_none()` in `xmem.rs`'s tests. - The transmutes of `write_sites.rs` keep their shape and carry the why in their SAFETY comments (committed executable pages, the width of a code address, the calling convention kept); the lint needs an attribute to be silenced, and the tests' bindings already name the function type. - What only diagnostics or tests use is allowed dead where it stands, the way `pipeline.rs` and `shadow.rs` already do (`#[cfg_attr(not(feature = "diagnostics"), allow(dead_code))]`): `host/indirects.rs` whole, `placed_filler_twins`, `Touch::Title`. I checked each first — all are referenced behind the diagnostics cfg or by tests; deleting would have broken those builds. - The three shape lints (`piece_at`'s eight arguments, `from_level`'s convention, `enum Late`'s variant size) carry `#[allow(clippy::...)]` with a one-line reason, as `record_clamp_as` already does. `indirect.rs` gets one attribute-only line (`Rig.depth_written`, written only; the tests clear through their own handle) — without it `--all-targets` cannot reach zero. ## Verification `cargo clippy --workspace --all-targets --locked -- -D warnings`: exit 0, zero warnings. `cargo test --workspace --locked --no-fail-fast`: 1055 passed, 2 failed — the same two GPU-dependent indirect tests as on main here (issue #211, an RTX 4060 Ti; not from this change). No new failures anywhere. ## Environment Windows 11, RTX 4060 Ti, Rust 1.98.1 (pinned).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!265
No description provided.