#const enummap

9 messages · Page 1 of 1 (latest)

hazy fable
sonic kraken
#

This crate appears to be a very roundabout way to write a match statement, to be honest

#

Its internals don't appear to be declared const, so you can't use it in const, but you could just not use it at all

#

Oh wait, it's a proper mutable map

#

What's the intended use case? Stable const is rather limited, it may or may not be possible

hazy fable
#

I want to convert chess piece type to a string, to display and add some coloring to it

sonic kraken
#

The easiest way to do that would just be to match on it, yeah

iron matrix
#

It's possible to use EnumMap::from_array which is const fn
other than that, it's not possible to create const enum maps due to Rust limitations 😦