Ultimate Rust Crash Course //top\\ Jun 2026

let x = 5; if x > 10 println!("x is greater than 10"); else println!("x is less than or equal to 10");

let config_max = Some(3u8); if let Some(max) = config_max { println!("Maximum is {}", max); } ultimate rust crash course

To avoid this error, we can use borrowing: let x = 5; if x > 10 println

fn plus_one(x: Option<i32>) -> Option<i32> match x None => None, Some(i) => Some(i + 1), let x = 5

Functions in Rust are declared using the fn keyword: