learning-rust

(β˜… 16)

Learning Guide to Become a Rustacean πŸ¦€

File Explorer

  • .gitignore
  • Cargo.lock
  • Cargo.toml
  • Macros.md
  • README.md

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

πŸ”

cargo build

View Details β–Ό

Compile a local package and all of its dependencies.

cargo {{[b|build]}}

Build the package or packages defined by the `Cargo.toml` manifest file in the local path:

cargo {{[b|build]}} {{[-r|--release]}}

Build artifacts in release mode, with optimizations:

cargo {{[b|build]}} --locked

Require that `Cargo.lock` is up to date:

πŸ”

cargo new

View Details β–Ό

Create a new Cargo package.
Equivalent of `cargo init`, but specifying a directory is required.

cargo new {{path/to/directory}}

Create a new Rust project with a binary target:

πŸ”

cargo run

View Details β–Ό

Run the current Cargo package.
Note: The working directory of the executed binary will be set to the current working directory.

cargo {{[r|run]}}

Run the default binary target:

cargo {{[r|run]}} --bin {{name}}

Run the specified binary:

cargo {{[r|run]}} --example {{name}}

Run the specified example:

// repository documentation