Hi !
How can I convert an "i32" variable to an enum value in #rust ?
The "cast" will be in the expression of a match.
I have seen some things about deriving "TryFrom" or "FromPrimitive" traits, but I'm not sure that's up to date.
I believe it's possible, but... how ?
Please, if you know how it works, tell me. x)
How can I convert an "i32" variable to an enum value in #rust ?
The "cast" will be in the expression of a match.
I have seen some things about deriving "TryFrom" or "FromPrimitive" traits, but I'm not sure that's up to date.
I believe it's possible, but... how ?
Please, if you know how it works, tell me. x)
silwol
•