-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement From<E>
for u32
when E
is #[repr(u32)] enum E
#2596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think |
|
Okay, yeah, I got confused. Don't mind me. |
I believe the most recent discussion on enum<->integer conversions is: https://internals.rust-lang.org/t/pre-rfc-enum-from-integer/6348 |
This other discussion appears to be mostly about |
This seems to fit better as something that could be derived, but not be automatic. Representation and having the conversion available in the API are not exactly the same thing. |
Since we do have conversion by |
I disagree. The fact that |
I just published a full RFC proposing making |
I think everything is in the title. I was very surprised to see that appears not to be already done, so I guess I'm missing something.
Should this go through the RFC process or just get implemented directly as an obvious thing, given eg.
u32: From<u16>
?The text was updated successfully, but these errors were encountered: