Blyx v0.1.0-alpha is here! Read the release notes ->

Chapter 7

Pattern Matching

Blyx has an extremely powerful control flow construct called match that allows you to compare a value against a series of patterns.

match msg {
    Message::Quit => println!("Quitting"),
    Message::Move { x, y } => println!("Move to {}, {}", x, y),
}
← Previous
Structs & Enums
Next →
Traits & Generics