rust-unused-code
Installation
SKILL.md
Rust Unused Code
Treat dead_code and unused_imports as useful feedback about the compiled
shape of the program, not as noise to suppress.
Working stance
- Start from the compiled configuration that raised the lint.
- Keep each module honest about what it actually depends on in that configuration.
- Bring code into scope only where that code is needed.
- Prefer changing compilation boundaries over adding lint suppressions.
- Treat
#[allow(dead_code)]and#[allow(unused_imports)]as a last resort that normally signals the design still needs tightening.
Core rule
If a symbol, import, or helper is only needed in some configurations, compile it only in those configurations.