1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-15 05:35:46 +02:00
tldr/pages/common/cargo-fix.md
2025-07-23 21:38:23 +05:30

28 lines
557 B
Markdown

# 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`
- Fix the package's library:
`cargo fix --lib`
- Fix the specified integration test:
`cargo fix --test {{name}}`
- Fix all members in the workspace:
`cargo fix --workspace`