3 ms·
I'm not sure I understand. If you have some code which doesn't care about the types which it is passing around, why isn't it generic? Also, I'm not sure if you
by woah 6y ago
I'm not sure I understand. If you have some code which doesn't care about the types which it is passing around, why isn't it generic?
Also, I'm not sure if you understand Rust enums. They should probably be called union types, because an enum in Rust signifies that the value can be one of a number of different types. This is extremely useful for code which has to handle a few different things differently. It's much more useful than the standard concept of an enum in languages such as Java and Rust, where it's just a dressed up integer flag.