A Cargo subcommand to find unused dependencies in Rust projects' Cargo.toml files.
cargo-udeps is a Cargo subcommand that scans Rust projects to identify unused dependencies declared in Cargo.toml files. It solves the problem of dependency bloat by detecting crates that are listed but never imported or used, helping developers reduce binary size and improve compile times. The tool integrates directly into the Cargo workflow and supports configuration to ignore specific dependencies.
Rust developers and teams working on projects with multiple dependencies who want to maintain lean and efficient codebases. It's particularly useful for projects with long-term maintenance or those aiming to optimize build performance.
Developers choose cargo-udeps because it's a specialized, open-source tool that seamlessly integrates with Cargo, offering precise detection of unused dependencies without manual inspection. Its ability to be configured as a pre-commit hook and support for ignoring false positives makes it a practical addition to Rust development workflows.
Find unused dependencies in Cargo.toml
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Runs as a Cargo subcommand (cargo udeps), seamlessly fitting into standard Rust development workflows without extra setup or configuration.
Supports ignoring dependencies via Cargo.toml metadata, allowing handling of false positives like doc-tests or special cases, as shown in the README example.
Can be integrated as a pre-commit hook, enabling automatic checks for unused dependencies before commits to maintain project cleanliness and efficiency.
Available through cargo install, GitHub releases, and multiple package managers like Homebrew and Nix, ensuring easy installation across different platforms.
Requires Rust nightly to run, which can be a barrier for projects or teams preferring stable toolchains, adding complexity to setup.
As admitted in known bugs, it may miss some unused crates, such as those used by std or transitive dependencies, reducing reliability and requiring manual verification.
Treats crates only by name, not version, which can cause problems when multiple versions of the same crate are present, leading to inaccurate detection.