You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Rust tutorial mentions that you can use let for destructuring patterns, but only in passing.
In particular, the sections that cover struct and tuples (and struct tuples) almost always use match rather than let to destructure their inputs, despite the fact that the patterns in these cases are irrefutable patterns.
I can understand wanting to minimize the number of concepts that are introduced, but let destructuring is so much more lightweight than match, we should try to point it out (a second time) in the struct/tuples section, perhaps immediately after the first instance of a use of match to destructure a struct.
The text was updated successfully, but these errors were encountered:
(I'm not saying we need to go whole-hog and attempt to actually define "irrefutable" patterns in the tutorial, since such a definition is more appropriately put into the reference manual. I'm just saying that it would be good for the tutorial to actually use good Rust style when appropriate and reasonable.)
The tutorial is eventually going away, and the new guide will absolutely 'use good Rust style when appropriate and reasonable.' I'm giving this a close.
The Rust tutorial mentions that you can use
let
for destructuring patterns, but only in passing.In particular, the sections that cover
struct
and tuples (and struct tuples) almost always usematch
rather thanlet
to destructure their inputs, despite the fact that the patterns in these cases are irrefutable patterns.I can understand wanting to minimize the number of concepts that are introduced, but
let
destructuring is so much more lightweight than match, we should try to point it out (a second time) in thestruct
/tuples section, perhaps immediately after the first instance of a use ofmatch
to destructure a struct.The text was updated successfully, but these errors were encountered: