Cargo Plugins
Subcommands that extend the capabilities of Cargo.
Writing code
Recipe | Crates | Categories |
---|---|---|
Generate a Rust project from a template | ||
Quickly open the crates.io or docs.rs page for the latest version of a crate |
Formatting and Linting
Recipe | Crates | Categories |
---|---|---|
Format your code | ||
Lint your code | ||
Fix compiler warnings automatically | ||
Format or lint your code before committing it |
Building
Recipe | Crates | Categories |
---|---|---|
cargo make | ||
Use devx | ||
Make Rust a better bash with xshell |
Watching for changes
Recipe | Crates | Categories |
---|---|---|
cargo watch | ||
cargo limit |
Cross-compiling
Recipe | Crates | Categories |
---|---|---|
Cross-compile using zig as the linker |
Auditing
Performance
Recipe | Crates | Categories |
---|---|---|
Configure your cargo project for maximum performance, fast compile times or minimal binary size | ||
cargo hakari |
Maintenance
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
| | |
See also
- Testing
- Build Utils
- Debugging
- FFI
- Procedural Macro Helpers
- Profiling
cargo-afl for fuzzing
cargo-asm and cargo-expand to investigate what the compiler generates from your code (cargo-expand shows the expanded output from macros)
cargo-audit for checking whether any of your dependencies are of a version that has a security advisory out against them.
cargo-bloat for identifying what's contributing to your binary's size (eg. modules with generic functions or macros not designed with size-efficiency in mind)
cargo-cache, cargo-sweep, and cargo-prune for keeping disk consumption by build artifacts and other regeneratable files under control.
cargo-deadlinks Check cargo doc output for broken old-style/manual intra-doc links.
cargo-edit for cargo add
cargo-geiger for identifying dependencies with unsafe code so you can either audit them or find alternatives if you don't feel skilled enough to do your own auditing.
cargo-modules for rendering a tree or Graphviz graph of the modules within a crate
cargo-outdated for listing packages that have newer versions than what your Cargo.toml and Cargo.lock are pinning.
cargo-tree to investigate dependencies (I like to use -d to list crates where more than one version is getting pulled in and what's pulling each version in.)
cargo-update to provide a cargo install-update to check for and install new versions of cargo install'd commands.
cargo-watch to re-run a command every time the source changes. (eg. cargo test)
flamegraph as an easy way to generate flamegraphs for visualizing performance profiles of Rust programs.
cargo-about, cargo-deny, cargo-license, or cargo-lichking for license compliance management
cargo-audit and cargo-sweep
cargo-spellcheck