mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-05 03:35:34 +02:00
cargo-{clean,fmt}: add page (#10770)
* cargo clean: add page * cargo fmt: add page
This commit is contained in:
parent
7113ea246c
commit
ffab1fa468
2 changed files with 36 additions and 0 deletions
20
pages/common/cargo-clean.md
Normal file
20
pages/common/cargo-clean.md
Normal 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
16
pages/common/cargo-fmt.md
Normal 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}}`
|
Loading…
Add table
Reference in a new issue