Hacker News new | ask | show | jobs
by n_u 22 days ago
> Cargo now reports unused dependencies to users, e.g.

> warning: unused dependency `tracing-subscriber` --> Cargo.toml:23:1 | 23 | tracing-subscriber.workspace = true | ^^^^^^^^^^^^^^^^^^ | = note: `cargo::unused_dependencies` is set to `warn` by default help: consider removing the dependency on `tracing-subscriber`

Heck yes

1 comments

Does this remove the need for machete or shear?
I believe so. The maintaner of cargo-udeps did most of the work as an effort to upstream it.

The main limitation is in dev-dep detection since there isn't a way to exhaustively run everything that uses dev-deps yet. You can look at logging statements to get an approximation though.

cargo-shear author updated their README:

https://github.com/boshen/cargo-shear#comparison-with-cargo-...

Personally, I find that a little hard to read; it discusses minutia where I was hoping to see a list of things missing from upstream lints.

As far as I can quickly skim, lints are missing at least unused dev-dependencies.