4 ms·
Of course, we can use i32 directly, but when project has hundreds of enum's, when enum's are constantly updated, when different crates are using different incom
by v_lisivka 8y ago
Of course, we can use i32 directly, but when project has hundreds of enum's, when enum's are constantly updated, when different crates are using different incompatible approaches to represent repr(C) enum's, it hurts. Rust compiler can pack Option<NonZeroU8> into single byte, so it can do that for repr(C) enum's with e.g. `Other(2..255:u8),` variant too (see my proposition above). Technically, they are not different, just have more specific cases.