Closed
Description
From the tutorial:
You've already seen simple let bindings, but let is a little fancier than you've been led to believe. It, too, supports destructuring patterns. For example, you can write this to extract the fields from a tuple, introducing two variables at once: a and b.
let (a, b) = get_tuple_of_two_ints();
Let bindings only work with irrefutable patterns: that is, patterns that can never fail to match. This excludes let from matching literals and most enum variants.
(emphasis mine)
This code compiles and behaves as expected:
let (a, b) = (1,2);
Have not included a pull request, as I'm not sure what the meaning of the passage is otherwise.
Metadata
Metadata
Assignees
Labels
No labels