Expressivenessmatch, if let & destructuring
All courses

Exhaustive pattern matching

match must cover all cases — the compiler rejects non-exhaustive matches. Guards (if x < 0) add conditions.

if let Some(x) = opt { } matches one pattern. Less ceremony than full match.

Output
Press Run to execute your code.