fix(clippy): remove or allow dead code in payload.rs and state.rs #5

Closed
HexC0d3rz wants to merge 1 commit from fix/ci-dead-code-payload-state into main
HexC0d3rz commented 2026-06-16 14:18:56 -04:00 (Migrated from github.com)

Summary

Fixes the 3 pre-existing -D warnings dead-code clippy errors on main that are currently blocking the Clippy job of PR #4 (fix(ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog).

Errors fixed

  1. crates/zeno-installer/src/payload.rs:73 — associated items to_json and example on impl Payload were flagged as never used.
  2. crates/zeno-installer/src/payload.rs:105 — free function stamp_with flagged as never used.
  3. crates/zeno-server/src/state.rs:21ConsoleSink::tx field flagged as never read.

Approach

For all three, the right call is #[allow(dead_code)] with an explanatory comment, not deletion:

  • to_json / example / stamp_with are exercised by the in-module #[cfg(test)] tests (roundtrip_stamp_and_read, corrupt_length_is_an_error, empty_fields_are_rejected). The production server does not call them — it re-implements the same byte layout in zeno-server/src/web/stamp.rs to avoid pulling the Windows-only installer crate into the Linux build — so they appear unused in the non-test build. The public API is kept stable for the test suite and any future consumer.
  • ConsoleSink::tx mirrors the existing #[allow(dead_code)] already on the sibling AgentSink::tx field. Both are reserved for the future console-to-agent backchannel; keeping the field on the struct means no schema migration when that path lands.

Verification

Local on this Linux dev box:

  • cargo fmt --all -- --check — passes
  • rustfmt --check crates/zeno-installer/src/payload.rs crates/zeno-server/src/state.rs — passes
  • cargo clippy -p zeno-server --all-targets -- -D warnings — passes (rebuilt fresh)
  • cargo clippy -p zeno-installer --all-targets -- -D warnings — the 3 reported errors are gone. Remaining warnings on Linux are #[cfg(target_os = "windows")]-gated code paths (consumed by install.rs on the Windows CI runner) and will not appear on the Windows CI job.

The full Windows MSVC + vcpkg toolchain is not available locally, so the workspace-wide cargo clippy --workspace --all-targets -- -D warnings cannot be run end-to-end here — the Windows CI is the source of truth.

Scope

  • Touches exactly the two files implicated by the 3 reported errors.
  • Does not touch crashlog.rs (PR #4 territory).
  • Does not refactor or rename anything.

Follow-up for PR #4

Once this lands, PR #4 just needs a rebase onto main (or main merged into its branch) and its Clippy job will turn green.

Blocks: PR #4 (fix/ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog)

## Summary Fixes the 3 pre-existing `-D warnings` dead-code clippy errors on `main` that are currently blocking the `Clippy` job of PR #4 (`fix(ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog`). ## Errors fixed 1. `crates/zeno-installer/src/payload.rs:73` — associated items `to_json` and `example` on `impl Payload` were flagged as never used. 2. `crates/zeno-installer/src/payload.rs:105` — free function `stamp_with` flagged as never used. 3. `crates/zeno-server/src/state.rs:21` — `ConsoleSink::tx` field flagged as never read. ## Approach For all three, the right call is `#[allow(dead_code)]` with an explanatory comment, not deletion: - `to_json` / `example` / `stamp_with` are exercised by the in-module `#[cfg(test)]` tests (`roundtrip_stamp_and_read`, `corrupt_length_is_an_error`, `empty_fields_are_rejected`). The production server does not call them — it re-implements the same byte layout in `zeno-server/src/web/stamp.rs` to avoid pulling the Windows-only installer crate into the Linux build — so they appear unused in the non-test build. The public API is kept stable for the test suite and any future consumer. - `ConsoleSink::tx` mirrors the existing `#[allow(dead_code)]` already on the sibling `AgentSink::tx` field. Both are reserved for the future console-to-agent backchannel; keeping the field on the struct means no schema migration when that path lands. ## Verification Local on this Linux dev box: - `cargo fmt --all -- --check` — passes - `rustfmt --check crates/zeno-installer/src/payload.rs crates/zeno-server/src/state.rs` — passes - `cargo clippy -p zeno-server --all-targets -- -D warnings` — passes (rebuilt fresh) - `cargo clippy -p zeno-installer --all-targets -- -D warnings` — the 3 reported errors are gone. Remaining warnings on Linux are `#[cfg(target_os = "windows")]`-gated code paths (consumed by `install.rs` on the Windows CI runner) and will not appear on the Windows CI job. The full Windows MSVC + vcpkg toolchain is not available locally, so the workspace-wide `cargo clippy --workspace --all-targets -- -D warnings` cannot be run end-to-end here — the Windows CI is the source of truth. ## Scope - Touches exactly the two files implicated by the 3 reported errors. - Does **not** touch `crashlog.rs` (PR #4 territory). - Does **not** refactor or rename anything. ## Follow-up for PR #4 Once this lands, PR #4 just needs a rebase onto `main` (or main merged into its branch) and its `Clippy` job will turn green. Blocks: PR #4 (`fix/ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog`)
HexC0d3rz commented 2026-06-16 16:27:26 -04:00 (Migrated from github.com)

Superseded by #6. PR #5 silenced the -D warnings dead-code lints in payload.rs and state.rs, but on its own it was blocked by the E0308 and E0610 errors in crates/zeno-agent/src/crashlog.rs that this branch inherits from main. #6 merges both the dead-code #[allow(dead_code)] attributes from #5 and the crashlog EXCEPTION_POINTERS/ExceptionCode fix from #4 into a single branch, so all CI checks can pass together. Closing in favor of #6.

Superseded by #6. PR #5 silenced the `-D warnings` dead-code lints in `payload.rs` and `state.rs`, but on its own it was blocked by the `E0308` and `E0610` errors in `crates/zeno-agent/src/crashlog.rs` that this branch inherits from `main`. #6 merges both the dead-code `#[allow(dead_code)]` attributes from #5 and the crashlog `EXCEPTION_POINTERS`/`ExceptionCode` fix from #4 into a single branch, so all CI checks can pass together. Closing in favor of #6.

Pull request closed

Sign in to join this conversation.
No description provided.