Closed
Description
There is a really useful feature currently in the match expression:
match foo {
ref mut a @ Something(_) => something_else(a),
...
}
if you don't know what it does it binds the entire thing matched to a variable, so in the above case something_else will be called with a mutable reference to foo if it meets the pattern Something(_).
The feature seems really useful but it's currently not documented anywhere, I guess someone should document it.
Metadata
Metadata
Assignees
Labels
No labels