cargo-udeps

Find unused dependencies in Cargo.toml

  • 所有者: est31/cargo-udeps
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

Dedicated packages

Some GNU/Linux distros have packaged cargo-udeps:

  • Nix/Nix OS: cargo-udeps
  • Arch via AUR: yay -S cargo-udeps

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.

主要指標

概覽
名稱與所有者est31/cargo-udeps
主編程語言Rust
編程語言Rust (語言數: 1)
平台
許可證Other
所有者活动
創建於2019-08-26 20:10:57
推送於2025-04-07 16:22:24
最后一次提交2025-04-07 12:22:24
發布數54
最新版本名稱v0.1.55 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數1.9k
關注者數8
派生數47
提交數554
已啟用問題?
問題數115
打開的問題數32
拉請求數124
打開的拉請求數4
關閉的拉請求數53
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?