cargo-{clean,fmt}: add page (#10770)

* cargo clean: add page

* cargo fmt: add page
pull/23/head
Lena 2023-10-01 10:47:34 +02:00 committed by GitHub
parent 7113ea246c
commit ffab1fa468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# cargo clean
> Remove generated artifacts in the `target` directory.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-clean.html>.
- 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}}`

16
pages/common/cargo-fmt.md Normal file
View File

@ -0,0 +1,16 @@
# cargo fmt
> Run `rustfmt` on all source files in a Rust project.
> More information: <https://github.com/rust-lang/rustfmt>.
- 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}}`