Maintain

Edit Cargo.toml

cargo_edit-github

Cargo commands for modifying a Cargo.toml file

This tool extends Cargo to allow you to add, remove, and upgrade dependencies by modifying your Cargo.toml file from the command line.

Currently available subcommands:

  • cargo upgrade
  • cargo set-version

Find unused dependencies

cargo udeps

cargo-udeps cargo-udeps-crates.io cargo-udeps-github cargo-udeps-lib.rs cat-development-tools cat-development-tools::cargo-plugins

udeps⮳ find unused dependencies in Cargo.toml.

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

cargo machete

cargo-machete cargo-machete-crates.io cargo-machete-github cargo-machete-lib.rs

cargo-machete is a Cargo tool that detects unused dependencies in Rust projects, in a fast (yet imprecise) way.

Machete

Install and run with:

cargo install cargo-machete
cargo machete

Detect dependencies that are out of date

cargo-outdated cargo-outdated-crates.io cargo-outdated-github cargo-outdated-lib.rs

Cargo subcommand for displaying when dependencies are out of date.

If you are using VS Code, also look into the Dependi VS Code plugin.

Lint your crate API changes for semver violations

cargo-semver-checks cargo-semver-checks-crates.io cargo-semver-checks-github cargo-semver-checks-lib.rs cat-command-line-utilities cat-development-tools::cargo-plugins

cargo-semver-checks scans your Rust crate for semver violations.

# If you already use `cargo-binstall` for faster tool installations:
$ cargo binstall cargo-semver-checks

# Otherwise:
$ cargo install cargo-semver-checks --locked

# Lint a new release for SemVer breakage before `cargo publish`:
$ cargo semver-checks

Manage the cargo cache

cargo-cache cargo-cache-crates.io cargo-cache-github cargo-cache-lib.rs cat-development-tools cat-command-line-utilities cat-development-tools::cargo-plugins

cargo cache⮳ manages the cargo cache ($CARGO_HOME or ~/.cargo/), shows sizes and removes directories selectively.