Right now the answer is that it’s not worth the time to swap out because:
implementation currently works
we use from_bits_truncate to drop unknown options (effectively validating at parse time)
it’s broadly similar to a HashSet of enums (in terms of API)
switching to bools would be nice but doesn’t seem worth it - we’d have to hand implement each of the 16 sets of flags or write some macros. And then we’re back to point 1 & 2 again
in rust a bool is 1 byte, meaning that we’d technically be growing the memory usage of insim.rs by switching. Relatively speaking I don’t think this is practically relevant, but I’m adding it for posterity.
The only thing I don’t enjoy about bitflags right now is the way it serialises with serde but that can be dealt with.
bitflags is great: stable, maintained, small.
But our usage is relatively simple and could easily implement the same functionality in equal or fewer LoC, and maintain a broadly similar API.
However, the rest of the insim crate has opted towards abstraction and simplification.
The most obvious and simple implementation would be to parse at encode and decode of a packet to a series of bools.
Does that work? Is that too abstract?