snippetbashTip
cargo fix — Automatically fix lint warnings reported by `rustc`. More information: <https://doc.rust-lang.org/ca
Viewed 0 times
commandfixcliautomaticallylintreportedcargo fixwarnings
Problem
How to use the
cargo fix command: Automatically fix lint warnings reported by rustc. More information: <https://doc.rust-lang.org/cargo/commands/cargo-fix.html>.Solution
cargo fix — Automatically fix lint warnings reported by rustc. More information: <https://doc.rust-lang.org/cargo/commands/cargo-fix.html>.Fix code even if it already has compiler errors:
cargo fix --broken-codeFix code even if the working directory has changes:
cargo fix --allow-dirtyMigrate a package to the next Rust edition:
cargo fix --editionFix the package's library:
cargo fix --libFix the specified integration test:
cargo fix --test {{name}}Fix all members in the workspace:
cargo fix --workspaceCode Snippets
Fix code even if it already has compiler errors
cargo fix --broken-codeFix code even if the working directory has changes
cargo fix --allow-dirtyMigrate a package to the next Rust edition
cargo fix --editionFix the package's library
cargo fix --libFix the specified integration test
cargo fix --test {{name}}Context
tldr-pages: common/cargo fix
Revisions (0)
No revisions yet.