Combining match and enums is useful in many situations. You’ll see this pattern a lot in Rust code: match against an enum, bind a variable to the data inside, and then execute code based on it. It’s a bit tricky at first, but once you get used to it, you’ll wish you had it in all languages. It’s consistently a user favorite - The Book of Rust
The book is not only a guide to writing #rust ;
It is a guide to good writing 🙂
nostr:nevent1qqstkvpptfvrw66fmy8mme2e9jc7qjja8djl2qt0uwdz5vh5qx0rl4gpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhsygp583fla8ykcfw42krqwmu0w39l63pwkmsatgnu9sqursld9xsejypsgqqqqqqsnmhsf6
Please Login to reply.
No replies yet.