profileRyan KesPGP keyI build stuffEmailGithubTwitterLast.fmMastodon


#+tags: namepage


Notes from reading The Rust Programming Language


Getting Started

Hello World example

fn main() {
    println!("Hello, world!");
  1. Functions & Macros

    println! calls a Rust Macro. Functions don't include the ! (ie println).

  2. Rustc

    Rustc handles Rust compilation rustc

  3. Cargo

    Cargo is Rust's build system and package manager

    1. Cargo commands

      1. Create project

        cargo new hello_cargo
      2. Build project

        cargo build
      3. Build & run project

        cargo run
      4. Check code

        cargo check
      5. Build for release

        cargo build --release
    2. Cargo.toml

      name = "hello_cargo"
      version = "0.1.0"
      authors = ["Your Name <>"]
      edition = "2018"