4 ms·
> What do Rust enums do that C enums don't? In Rust, an enum can also carry data along with the tag, and the type of the data can be different for each value o
by cesarb 3y ago
> What do Rust enums do that C enums don't?
In Rust, an enum can also carry data along with the tag, and the type of the data can be different for each value of the tag. A Rust enum is more like a "tagged union" (a struct containing both an enum as the tag and a union for the extra data) in C.