chore: prune #[allow(dead_code)] cluster (#327)#470
Merged
intendednull merged 1 commit intoApr 28, 2026
Merged
Conversation
audit #327 listed 13 sites. count drifted to 10 (storage.rs and 2 others removed in earlier work). per-site breakdown: deletes (genuinely unused): - crates/web/src/app.rs::toggle_theme — never called; on_toggle_theme Callback wires through palette_actions, not this fn. remove redundant annotation (symbol used): - crates/web/src/palette_recents.rs::clear — used by browser tests. - crates/web/tests/browser.rs::TestShell, mount_test_with_shell, ensure_components_css_loaded, mod test_support — all referenced throughout browser.rs flow tests. - crates/web/src/state.rs::set_pinned_messages — used in state.rs:952. - crates/web/src/state.rs::set_pin_labels — fed by struct init only; field access not warned because crate-wide #![allow(dead_code)] in willow-web/src/lib.rs already masks it. annotation was redundant. - crates/web/src/components/mobile_shell.rs::MobilePush — match arms on Thread/Call/Onboarding count as use; no warning even when one variant is constructed. keep with reason: - crates/actor/src/fsm.rs::DoorState::Open — test fixture for StrictDoor rejection path; never constructed because tests start in Closed and assert further transitions are rejected. Kept with #[allow(dead_code, reason = ...)] (rust 1.81+). verification: cargo check --workspace --all-targets clean; cargo clippy -D warnings clean; cargo test --workspace passes; wasm32 lib + tests build clean. scope-creep guard hit: removing willow-web's crate-wide #![allow(dead_code)] surfaces 9 unrelated dead symbols across 5 files. left as-is — separate follow-up. Refs #327
This was referenced Apr 28, 2026
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.
audit #327 listed 13 dead_code annotations. count drifted to 10 (storage.rs gone, 2 web sites already cleaned).
actions per site
delete (genuinely unused):
crates/web/src/app.rs::toggle_theme— fn never called. theme toggling routes throughpalette_actions::on_toggle_themeCallback.remove redundant annotation (symbol IS used):
crates/web/src/palette_recents.rs::clear— used in browser test fixtures (tests/browser.rs:5043, 5066).crates/web/tests/browser.rs::TestShellenum — used by every flow test viamount_app_fresh.crates/web/tests/browser.rs::mount_test_with_shell— used 30+ times throughout browser.rs.crates/web/tests/browser.rs::ensure_components_css_loaded— called bymount_test_with_shell+test_support::ensure_app_css.crates/web/tests/browser.rs::mod test_support— used by basic_flow, mobile_ux, mobile_actions modules.crates/web/src/state.rs::ChatWriteSignals::set_pinned_messages— used in state.rs:952 (Effect feeds pinned signal).crates/web/src/state.rs::ChatWriteSignals::set_pin_labels— fed by struct init only, but masked by crate-wide#![allow(dead_code)]in willow-web — per-field annotation was always redundant.crates/web/src/components/mobile_shell.rs::MobilePush— Channel/Thread/Call/Onboarding all match-bound; Thread/Call/Onboarding planned perdocs/plans/2026-04-20-ui-phase-1b-mobile-shell.md. no warning fires.keep with
reason:crates/actor/src/fsm.rs::DoorState::Open—StrictDoortest fixture starts inClosedand asserts further transitions are rejected.Openexists for completeness in the enum but is never constructed; removing the annotation triggersvariant Open is never constructed. Replaced with#[allow(dead_code, reason = ...)](rust 1.81+).scope-creep guard
willow-web/src/lib.rscarries crate-wide#![allow(dead_code)]. that's masking 9 other dead symbols across 5 unrelated files (downgrade_banner, day_separator, nickname_store, trust_store). per coordinator's >5-files / >200-LOC guard, left intact — separate follow-up. that crate-wide allow also explains why some per-site annotations on willow-web items were no-ops; removing them is still correct hygiene since the crate-wide allow itself should eventually go.tradeoffs
runner-up for
MobilePush: keep#[allow(dead_code)]since 3/4 variants never constructed. rejected because match arms on those variants count as use — no warning fires; annotation is misleading.runner-up for
DoorState: deleteOpenvariant entirely. rejected because the enum's binary state models a real door and theStrictDoor::transitionmatch stateonDoorState::Open => Ok(...)arm is the readable rejection-path test surface; gutting it would force_arms or single-variant enums.verify
cargo check --workspace --all-targets— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --check— cleancargo test --workspace— all green (90 actor + 298 client + 227 state + ...)cargo check --target wasm32-unknown-unknown -p willow-web --tests— cleanRefs #327
Generated by Claude Code