Skip to content

Glossary: Rust Basics

_ (wildcard pattern)

Also written: catch-all, underscore pattern

In a `match`, `_` matches anything not covered by earlier arms, so it is put last. In a `for` loop, `_` names a variable you don't need.

Where the book teaches it

Related terms

match