From ffab1fa468b605316f00db8e59df33fe3b389cc1 Mon Sep 17 00:00:00 2001 From: Lena <126529524+acuteenvy@users.noreply.github.com> Date: Sun, 1 Oct 2023 10:47:34 +0200 Subject: [PATCH] cargo-{clean,fmt}: add page (#10770) * cargo clean: add page * cargo fmt: add page --- pages/common/cargo-clean.md | 20 ++++++++++++++++++++ pages/common/cargo-fmt.md | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 pages/common/cargo-clean.md create mode 100644 pages/common/cargo-fmt.md diff --git a/pages/common/cargo-clean.md b/pages/common/cargo-clean.md new file mode 100644 index 0000000000..1500c39f16 --- /dev/null +++ b/pages/common/cargo-clean.md @@ -0,0 +1,20 @@ +# cargo clean + +> Remove generated artifacts in the `target` directory. +> More information: . + +- Remove the entire `target` directory: + +`cargo clean` + +- Remove documentation artifacts (the `target/doc` directory): + +`cargo clean --doc` + +- Remove release artifacts (the `target/release` directory): + +`cargo clean --release` + +- Remove artifacts in the directory of the given profile (in this case, `target/debug`): + +`cargo clean --profile {{dev}}` diff --git a/pages/common/cargo-fmt.md b/pages/common/cargo-fmt.md new file mode 100644 index 0000000000..478eb12689 --- /dev/null +++ b/pages/common/cargo-fmt.md @@ -0,0 +1,16 @@ +# cargo fmt + +> Run `rustfmt` on all source files in a Rust project. +> More information: . + +- Format all source files: + +`cargo fmt` + +- Check for formatting errors without writing to the files: + +`cargo fmt --check` + +- Pass arguments to each `rustfmt` call: + +`cargo fmt -- {{rustfmt_args}}`