#Best way to convert int to enums safely?

1 messages · Page 1 of 1 (latest)

brisk grove
#

Say i have an enum thats represented by u8

#

But i only have a few enums

#

@enumFromInt says it will trigger undefined behavior?

#

So whats the safest way to cast to enum?

brisk grove
#

WOAH

#

nice