Maintain
Recipe | Crates | Categories |
---|---|---|
Edit Cargo.toml | ||
Find unused dependencies | ||
Detect dependencies that are out of date | ||
Lint your crate API changes for semver violations | ||
Manage the cargo cache |
| cargo expand
| | |
| cargo hack
| | |
Edit Cargo.toml
cargo edit
provides commands for modifying a Cargo.toml
file. It allows 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
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
⮳ is a Cargo tool that detects unused dependencies in Rust projects, in a fast (yet imprecise) way.
Install and run with:
cargo install cargo-machete
cargo machete
Detect dependencies that are out of date
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
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
⮳ manages the cargo
cache ($CARGO_HOME or ~/.cargo/), shows sizes and removes directories selectively.
cargo expand
Wrapper around rustc -Zunpretty=expanded
. Shows the result of macro expansion and #[derive]
expansion.
cargo hack
Cargo subcommand to provide various options useful for testing and continuous integration.