#cargo

bin+lib cargo-udeps

Find unused dependencies in Cargo.toml

12 releases

✓ Uses Rust 2018 edition

0.1.11 Apr 23, 2020
0.1.10 Mar 16, 2020
0.1.7 Jan 31, 2020
0.1.6 Dec 1, 2019
0.1.1 Aug 31, 2019

#28 in #cargo

Download history 97/week @ 2020-02-08 163/week @ 2020-02-15 173/week @ 2020-02-22 239/week @ 2020-02-29 266/week @ 2020-03-07 338/week @ 2020-03-14 274/week @ 2020-03-21 199/week @ 2020-03-28 141/week @ 2020-04-04 217/week @ 2020-04-11 185/week @ 2020-04-18 146/week @ 2020-04-25 158/week @ 2020-05-02 101/week @ 2020-05-09 157/week @ 2020-05-16 81/week @ 2020-05-23

896 downloads per month

MIT/Apache and MPL-2.0+

41KB
1K SLoC

cargo-udeps

crates.io dependency status

Find unused dependencies in Cargo.toml.

While compilation of this tool also works on Rust stable, it needs Rust nightly to actually run.

Installation

GitHub Releases

https://github.com/est31/cargo-udeps/releases

cargo install (crates.io)

cargo install cargo-udeps --locked

cargo install (master)

cargo install --git https://github.com/est31/cargo-udeps --locked

Usage

cargo +nightly udeps

It either prints out a "unused crates" line listing the crates, or it prints out a line saying that no crates were unused.

Ignoring some of the dependencies

To ignore some of the dependencies, add package.metadata.cargo-udeps.ignore to Cargo.toml.

[package.metadata.cargo-udeps.ignore]
normal = ["if_chain"]
#development = []
#build = []

[dependencies]
if_chain = "1.0.0" # Used only in doc-tests, which `cargo-udeps` cannot check.

Known bugs

  • Some unused crates might not be detected. This includes crates used by std and its dependencies as well as crates that are already being used by dependencies of the studied crate.

  • Crates are currently only handled on a per name basis. Two crates with the same name but different versions would be a problem.

Trophy case

This is a list of cases where unused dependencies were found using cargo-udeps. You are welcome to expand it:

License

This tool is distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your option.

See LICENSE for details.

License of your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~33MB
~764K SLoC