|
|
|
|
|
by clownstrikelol
15 days ago
|
|
Sure you can, bringing data along for the ride is optional in Rust. Nothing is forcing you to use it like a tagged union, it’s an optional (but useful) feature. If you want specific values (integer or otherwise) associated with specific variants (i.e. Human = 1, Cat = 4) you can do that too. Use the #[repr(T)] or impl the From / Into traits yourself. |
|