Noob @rustlang question: How can I express enums that contain "map" to string values? E.g. in TS i'd do:
enum Somthing {
Foo = 'foo',
Bar = 'bar'
}
Do I really have to combine Rust's enum with a HashMap?
Reason: I'd like to pattern match a string but stay typed.
-
Show this thread
-
Replying to @thekbknapp @PascalPrecht
And someday TryFrom/TryInto
6:00 PM - 2 Apr 2019
0 replies
0 retweets
6 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.