Rust

Most of this is from an initial read-through of the Rust Book.

Shadowing

Re-bind an immutable identifier without requiring the use of mut:

fn main() {
    let x = 5;
    let x = x + 1;
    let x = x * 2;

    println!("The value of x is: {}", x);
}

Expressions

  • Rust has expressions and statements:
    • expressions return a value based on their operand
    • statements simply return a () type which behaves just like void
Edit