You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #483 on June 16, 2021 17:32.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
is it possible to create an enum object from its string representation? I know there is a
from_i32
method, but what about something likefrom_str?
e.g. consider the enum
Color
and i have the string "red", I would like to return aColor::red
enum object. thanksBeta Was this translation helpful? Give feedback.
All reactions