Rust · Macro
matches!
The Rust matches! macro checks whether an expression fits a pattern. It returns false when an optional guard is not true.
Last updated
- Since
- 1.42.0
Syntax
matches!(expression, pattern [if guard])In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
assert_matches!match