Control Flow with If Expressions
In Rust, 'if' is an expression, not just a statement. This means it returns a value that can be assigned to a variable, provided all branches return the same type.
fn main() {let number = 7;let condition = if number < 10 {true} else {false};println!("Condition is {condition}");}