3 ms·
Concerning the "Pattern matching" section, I've never, in all my time programming Rust, seen that specific pattern of destructuring the input values of the func
by Lev1a 9y ago
Concerning the "Pattern matching" section, I've never, in all my time programming Rust, seen that specific pattern of destructuring the input values of the function in the fn declaration part.
Now I feel the need to use that everywhere...
- steveklabnik 9y agoA lot of people didn't know! I made sure to put it in the book explicitly: https://doc.rust-lang.org/book/second-edition/ch18-01-all-the-places-for-patterns.html#function-parameters https://doc.rust-lang.org/book/second-edition/ch18-01-all-th...
- Lev1a 9y agoHuh, was that also in the first edition? I learned using that and if this pattern matching pattern (heh) is indeed in there, I must have overread it...
- steveklabnik 9y agoI’m not sure, to be honest, it’s been a long time!