How do I remove unused dependencies in Cargo.toml?

Viewed 1327

How do I find out the dependencies in Cargo.toml that are unused? How can I remove them automatically?

1 Answers

One option is to use cargo-udeps.

To find unused dependencies in production target:

cargo +nightly udeps

To find unused dev dependencies:

cargo +nightly udeps --all-targets
Related