Rust's Match Construct: Controlling Program Flow With Pattern Matching
Rust's match construct controls program flow like if-else, but more powerful & addictive! Evaluate multiple possibilities, handle all types with exhaustive matches, and catch common outcomes with the `_` pattern.
My journey in learning the Rust language continues. Today, let’s explore one of Rust’s unique methods of controlling program flow, known as the match construct. The match syntax is really addictive, and sorely missed when you use other languages. Previously, I’ve explored the traditional ways of controlling program [flow](https://dev.to/crusty-rustacean/rust-decisions-decisions-591, namely if..else and looping. Rust has another way, the match construct, which allows your code to evaluate and act on multiple possibilities. Let’s dive in and explore through a fun, silly little Star Wars themed e...