6. Filtering and enumerations
The match statement acts like an if conditional generalized to any number of branches. The match statement is similar to the switch statement in C or Java, the case statement in Pascal or Ada, or the cond and case forms in Scheme. We'll see in the next section that it's particularly well suited to programming with enumerated types. Here's a simple example using numbers.
use std::io;
fn main() {
let mut saisie = String::new();
let mut number_seized: i32 = 999;
while number_seized != 0 {
...
You do not have access to this resource.
Exclusive to subscribers. 97% yet to be discovered!
Already subscribed?
Log in!
Ongoing reading
Filtering and enumerations