4 ms·
In Rust plain C-style `union`s (used with the `union`) keyword are associated with `unsafe`. The ergonomic, standard replacement is `enum`. So you would do, e.g
by Ar-Curunir 4y ago
In Rust plain C-style `union`s (used with the `union`) keyword are associated with `unsafe`. The ergonomic, standard replacement is `enum`. So you would do, e.g., `enum Option<T> { Some(T), None }` to represent a nullable value in the type system.