Reputation: 6170
For a few Rust versions now, one can do _ = foo()
instead of let _ = foo()
in assignments. However, I can not recall the name of this syntax and can't find official documentation for it. I also don't find the PR in the rustlang repo. Can anyone provide some context, please?
Upvotes: 5
Views: 270
Reputation: 71380
It is part of the destructuring assignment RFC, that allows pattern to be used for assignments and not just variable declaration. Stabilized in Rust 1.59.0.
Upvotes: 5