Search code examples
rustlintrust-cargorust-clippy

Can Rust's clippy do autocorrection / autofix?


Is it possible to run cargo clippy with an option so it will fix warnings automatically?

From the help message, it does not look like this option is supported at the moment.


Solution

  • As of June 2021 the autofix capability has been stabilized, you can apply changes using the following command

    cargo clippy --fix