Maintain

TopicRust Crates
Code Formattingcargo fmt formats your code to a consistent style.
Lintingcargo clippy catches common code errors and style issues.
Dependency Managementcargo tree displays your dependency tree to help you understand your project's dependencies. cargo outdated checks for outdated dependencies. cargo audit checks for crates with known security vulnerabilities.
Documentation Generationcargo doc generates documentation from your code. cargo deadlinks finds broken links in your documentation.
Testingcargo test runs your unit and integration tests.
Benchmarkingcargo bench runs your benchmarks.
Code Coveragecargo tarpaulin runs code coverage analysis.
RefactoringOften IDE-driven, but some tools exist: cargo-expand expands macros, which can be helpful for understanding code and refactoring.
Version Managementcargo-bump helps to automate version updates in your Cargo.toml.

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.

cargo expand

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

cargo expand is a wrapper around rustc -Zunpretty=expanded. Shows the result of macro expansion and #[derive] expansion.

cargo hack

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

cargo hack is a cargo subcommand to provide various options useful for testing and continuous integration.