The match Control Flow Construct - The Rust Programming Language
Rust has an extremely powerful control flow construct called match that allows you to compare a value against a series of patterns and then execute code based on which pattern matches. Patterns can be made up of literal values, variable names, wildcards, and many other things; Chapter 18 covers all the different kinds of patterns and what they do. The power of match comes from the expressiveness of the patterns and the fact that the compiler confirms that all possible cases are handled.
The match Control Flow Construct - The Rust Programming Language Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu The Rust Programming Language The match Control Flow Construct Rust has an extremely powerful control flow construct called match that allows you to compare a value against a series of patterns and then execute code based on which pattern matches. Patterns can be made up of literal values, variable names, wildcards, and many other things; Chapter 19 cov
Explore this link on the map →saved by
related reading
- Control Flow - The Rust Programming Languagedoc.rust-lang.org
- Programming a Guessing Game - The Rust Programming Languagedoc.rust-lang.org
- Defining an Enum - The Rust Programming Languagedoc.rust-lang.org
- Methods - The Rust Programming Languagedoc.rust-lang.org
- A half-hour to learn Rustfasterthanli.me
- Item 7: Use builders for complex types - Effective Rustlurklurk.org
- Control Flow - The Rust Programming Languagerust-book.cs.brown.edu
- An Example Program Using Structs - The Rust Programming Languagedoc.rust-lang.org
- Variables and Mutability - The Rust Programming Languagedoc.rust-lang.org
- Patterns for Defensive Programming in Rust | corrode Rust Consultingcorrode.dev
- Rust Language Cheat Sheetcheats.rs
- References and Borrowing - The Rust Programming Languagedoc.rust-lang.org