Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

42
cargo Normal file
View File

@@ -0,0 +1,42 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# cargo
> Manage Rust projects and their module dependencies (crates).
> Some subcommands such as `build` have their own usage documentation.
> More information: <https://doc.rust-lang.org/cargo>.
- Search for crates:
`cargo search {{search_string}}`
- Install a binary crate:
`cargo install {{crate_name}}`
- List installed binary crates:
`cargo install --list`
- Create a new binary or library Rust project in the specified directory (or the current working directory by default):
`cargo init --{{bin|lib}} {{path/to/directory}}`
- Add a dependency to `Cargo.toml` in the current directory:
`cargo add {{dependency}}`
- Build the Rust project in the current directory using the release profile:
`cargo build --release`
- Build the Rust project in the current directory using the nightly compiler (requires `rustup`):
`cargo +nightly build`
- Build using a specific number of threads (default is the number of logical CPUs):
`cargo build --jobs {{number_of_threads}}`