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

Open
github-bot wants to merge 1 commit from github-bot/gh-265 into main AGit
Owner

@⁠Cannnabis on GitHub · 2026-11-27 20:19 UTC · original
Cannnabis:clippy-workspace-clean → main · +53 −27 · 23 files · 1 commits · open

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).

**@⁠Cannnabis** on GitHub · 2026-11-27 20:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/265) `Cannnabis:clippy-workspace-clean` → `main` · +53 −27 · 23 files · 1 commits · open ## 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).
Mechanical, no behavior changes: is_multiple_of, the precedence
parentheses, the hex literals grouped, sort_unstable_by_key, needless
borrows, drop of a Copy, contains_key. The transmutes of write_sites.rs
keep their shape and carry the why (the pages are committed, of a code
address's width, the calling convention kept). What only diagnostics or
tests use is allowed dead where it stands, as pipeline.rs and
shadow.rs already do, and the three shape lints carry the reason.

The CI's clippy step passes from here on.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 20:21:25 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/resource.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/265/head:github-bot/gh-265'
git switch 'github-bot/gh-265'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-265'
git switch 'github-bot/gh-265'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-265'
git switch 'github-bot/gh-265'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-265'
git switch 'main'
git merge --squash 'github-bot/gh-265'
git switch 'main'
git merge --ff-only 'github-bot/gh-265'
git switch 'main'
git merge 'github-bot/gh-265'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.