Binding with @
Capture and test.
The @ Binding Operator
The @ operator lets you test a value against a pattern and bind it to a name at the same time. You get both the check and the value.
The Problem It Solves
With a range pattern you know a value fell in range, but you lose access to the specific value. @ captures it while still testing the range.
All lessons in this course
- match Deep Dive
- if let and while let
- Binding with @
- Destructuring