Functions annotate parameter and return types. A block's final expression, written without a semicolon, is its value. `if`, `match`, blocks and `loop` are all expressions that can produce values.
← Rust theorytheory 0/50 · 0%
Fundamentals · easy
5. Functions and Expressions
Rust is an expression language.
Check your understanding
1. A trailing expression without a semicolon…
2. Is `if` an expression?