Step Into Rust · Lesson 2 · Foundations
Functions & Control Flow
Expressions, functions, if, loop / while / for, ranges and match.
- ~30 minreading and coding
- 4missions
- membersaccess
- Rustlanguage
Part of Step Into Rust. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.
In Rust, if, match and blocks produce values. The last expression in a block, without a semicolon, is its value:
In this lesson
- Everything is an expression
- Loops
- match
Missions
- A function
- Inclusive ranges
- match
- break with a value