fix(clippy): remove or allow dead code in payload.rs and state.rs #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hex/zeno-rmm!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/ci-dead-code-payload-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the 3 pre-existing
-D warningsdead-code clippy errors onmainthat are currently blocking theClippyjob of PR #4 (fix(ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog).Errors fixed
crates/zeno-installer/src/payload.rs:73— associated itemsto_jsonandexampleonimpl Payloadwere flagged as never used.crates/zeno-installer/src/payload.rs:105— free functionstamp_withflagged as never used.crates/zeno-server/src/state.rs:21—ConsoleSink::txfield 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_withare 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 inzeno-server/src/web/stamp.rsto 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::txmirrors the existing#[allow(dead_code)]already on the siblingAgentSink::txfield. 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— passesrustfmt --check crates/zeno-installer/src/payload.rs crates/zeno-server/src/state.rs— passescargo 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 byinstall.rson 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 warningscannot be run end-to-end here — the Windows CI is the source of truth.Scope
crashlog.rs(PR #4 territory).Follow-up for PR #4
Once this lands, PR #4 just needs a rebase onto
main(or main merged into its branch) and itsClippyjob will turn green.Blocks: PR #4 (
fix/ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog)Superseded by #6. PR #5 silenced the
-D warningsdead-code lints inpayload.rsandstate.rs, but on its own it was blocked by theE0308andE0610errors incrates/zeno-agent/src/crashlog.rsthat this branch inherits frommain. #6 merges both the dead-code#[allow(dead_code)]attributes from #5 and the crashlogEXCEPTION_POINTERS/ExceptionCodefix from #4 into a single branch, so all CI checks can pass together. Closing in favor of #6.Pull request closed