| Crates.io | unused-pub |
| lib.rs | unused-pub |
| version | 0.1.3 |
| created_at | 2026-01-23 02:57:53.609564+00 |
| updated_at | 2026-01-23 03:39:17.787542+00 |
| description | A tool to detect unused public items (structs, enums, functions, etc.) in a Rust codebase. |
| homepage | |
| repository | https://github.com/kroucher/unused-pub |
| max_upload_size | |
| id | 2063263 |
| size | 36,738 |
A Cargo subcommand/CLI tool to detect potentially unused pub items in your Rust crate.
It identifies public structs, enums, functions, consts, traits, and types that are defined but never used within the codebase. This is useful for cleaning up libraries or identifying dead code in large workspaces.
foo::bar::Baz), imports (use), macro invocations (format!("{Foo}")), and doc comments (/// [Foo]).cargo install unused-pub
Run the tool on your project directory:
unused-pub <path-to-project>
Example:
unused-pub .
You can filter by type (struct, enum, fn, const, trait, type) using the -f flag:
# Only find unused structs
unused-pub . -f struct
# Find unused structs and enums
unused-pub . -f struct -f enum
.rs files.syn to parse ASTs.pub items.pub item that is not found in the "usages" set is reported.MIT
Are welcome!