3 ms·
Rust calls this feature "C style enums," so while you're right there are differences, it's sort of a term of art in this context. ("style" is supposed to refle
by steveklabnik 6y ago
Rust calls this feature "C style enums," so while you're right there are differences, it's sort of a term of art in this context.
("style" is supposed to reflect that it's similar, but not the same thing.)
- ChrisSD 6y agoYeah. I hate it ;). I already have enough trouble trying to explain to new people the difference between C and Rust enums. The phrase "C style" just confuses things more, IMHO. Admittedly this may be a failure of communication on my part.
- steveklabnik 6y agoThat's fair :) I don't think the name was super carefully considered, to be honest, it just kinda happened.
- drran 6y agoC enums in Rust can be declared as: enum Foo { A=0, B=1, C=3, _UNKNOWN(i32), } However, this cannot be compiled by current Rust compiler.