Detecting unnecessary dependencies in cargo.toml

Is there anyway to detect if a dependency in Cargo.toml is unnecessary?

Check out cargo-udeps.

There's also cargo-machete.

2 Likes

Unfortunately that requires nightly

That is what I am looking for

The easiest way to prevent from building unused deps is set -F/-D unused-crate-dependencies in .cargo/config.toml file if you don't want to install third party tools.

2 Likes

F/-D unused-crate-dependencies in .cargo/config.toml

I had no idea what ".cargo/config.toml"is for, and only a hazy idea it existed
Here it is

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.