2025-03-14 21:59:59 -06:00
|
|
|
# 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-code`
|
|
|
|
|
|
|
|
|
|
- Fix code even if the working directory has changes:
|
|
|
|
|
|
|
|
|
|
`cargo fix --allow-dirty`
|
|
|
|
|
|
|
|
|
|
- Migrate a package to the next Rust edition:
|
|
|
|
|
|
|
|
|
|
`cargo fix --edition`
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
- Fix the package's library:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`cargo fix --lib`
|
|
|
|
|
|
|
|
|
|
- Fix the specified integration test:
|
|
|
|
|
|
|
|
|
|
`cargo fix --test {{name}}`
|
|
|
|
|
|
|
|
|
|
- Fix all members in the workspace:
|
|
|
|
|
|
|
|
|
|
`cargo fix --workspace`
|