| Crates.io | cargo-neat |
| lib.rs | cargo-neat |
| version | 0.2.4 |
| created_at | 2025-12-26 11:10:05.481779+00 |
| updated_at | 2026-01-21 12:44:46.186047+00 |
| description | A tool to complement cargo-machete and remove unused workspace dependencies |
| homepage | |
| repository | https://github.com/killzoner/cargo-neat |
| max_upload_size | |
| id | 2005587 |
| size | 156,893 |
Keep your cargo workspace neat
A command to complement existing tools like cargo-machete when working with a Cargo workspace.
Features:
workspace.dependencies when working with a cargo workspace-m option)-p option). Metadata section values can be customized and currently defaults to --package-workspace-meta-values "rust-version,edition,license,homepage,repository"Install with cargo:
cargo install cargo-neat --locked
cd my-directory && cargo neat
or alternatively
cargo neat my-directory
cargo neat -m -p my-workspace
Unused workspace dependencies :
└── /home/user/my-workspace/Cargo.toml
├── anyhow
└── clappen
Non workspace dependencies :
├── /home/user/my-workspace/crate1/Cargo.toml
│ ├── argh
│ └── futures-lite
└── /home/user/my-workspace/crate2/Cargo.toml
└── clap
Non workspace metadata :
├── /home/user/my-workspace/crate1/Cargo.toml
└── edition
The return code gives an indication whether unused dependencies have been found:
name: Cargo neat checks
on:
pull_request: { branches: "*" }
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: taiki-e/checkout-action@v1 # or standard actions/checkout
- name: Install cargo neat
uses: taiki-e/install-action@v2
with:
tool: cargo-neat
- name: Run cargo neat
run: cargo neat -m -p
A working example can be found in cargo-neat CI
A lot of the code structure is drawn from the great cargo-machete. If you don't already use it, you probably should.
I would need a mix of cargo-machete/shear and cargo-neat. However cargo-shear is marked feature complete and not accepting new features, so here is cargo-neat.