Closed dev-ardi closed 1 year ago
bitflags! { /// The parsing mode #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct ParseRule: u8 { /// Don't allow any invalid field or value const STRICT = 0b00000000; /// Allow unknown field const ALLOW_UNKNOWN_FIELDS = 0b00000001; } }
Why didn't you just use an enum?
because it is meant to become non-exclusive rules in the possible future.
In that case you could use a packed struct of enums, bitfields are an old C pattern, and enums are more ergonomic in Rust.
Why didn't you just use an enum?