Files
tldr/pages/common/cargo-fix.md
2023-10-02 15:02:25 +02:00

37 lines
779 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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`
- Fix the packages library:
`cargo fix --lib`
- Fix the specified integration test:
`cargo fix --test {{name}}`
- Fix all members in the workspace:
`cargo fix --workspace`
- Set the directory for all generated artifacts and intermediate files:
`cargo fix --target-dir {{path/to/directory}}`
- Restrict Cargo from access to network for any reason:
`cargo fix --offline`
- Run `n` jobs in parallel (default: number of logical CPUs):
`cargo fix --jobs {{n}}`