From 96fec4b3550a639bc7ec93d30ae9a1bab543bb21 Mon Sep 17 00:00:00 2001 From: Sunil Thunga <76161837+Cioraz@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:32:25 +0530 Subject: [PATCH] cargo-fix: add page (#10774) Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/common/cargo-fix.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/cargo-fix.md diff --git a/pages/common/cargo-fix.md b/pages/common/cargo-fix.md new file mode 100644 index 000000000..c1bf38f56 --- /dev/null +++ b/pages/common/cargo-fix.md @@ -0,0 +1,36 @@ +# cargo fix + +> Automatically fix lint warnings reported by `rustc`. +> More information: . + +- 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 package’s 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}}`