Rust 101: Basic Syntax Cheat Sheet
A quick reference for the core building blocks of Rust.
1. Variables
rust
let x = 5; // immutable (default)
let mut y = 10; // mutable
y = 15; // OK because y is mut
// x = 6; // ERROR: cannot assign twice to immutable variable