3 ms·
Pattern matching can be done over structs as well, in Rust.
by diarrhea 3y ago
Pattern matching can be done over structs as well, in Rust.
- cmrdporcupine 3y agoNot nearly as expressively though. You can destructure a struct, but you can't express alternatives on anything but an enum. Languages like F#, Scala, Haskell support more ways of creating ADTs than the kind of enums that Rust has.