Step Into Labs

Step Into Rust · Lesson 2 · Foundations

Functions & Control Flow

Expressions, functions, if, loop / while / for, ranges and match.

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

Missions

  1. A function
  2. Inclusive ranges
  3. match
  4. break with a value