cargo-clippy

A collection of lints to catch common mistakes and improve your Rust code.

TLDR

Run checks over the code in the current directory

$ cargo clippy
copy

Require that Cargo.lock is up to date

$ cargo clippy --locked
copy

Run checks on all packages in the workspace

$ cargo clippy --workspace
copy

Run checks for a package

$ cargo clippy --package [package]
copy

Treat warnings as errors

$ cargo clippy -- --deny warnings
copy

Run checks and ignore warnings

$ cargo clippy -- --allow warnings
copy

Apply Clippy suggestions automatically

$ cargo clippy --fix
copy

Copied to clipboard
3commas