Closed boxdot closed 5 years ago
Hey, thanks for merging. My use case is actually json and bincode at the same time, but the bitset is not used in Vec's or other containers, so I went for an easy solution. I would like to reduce the size of serialized data by using the underlying repr of T
if is it possible in a consecutive PR. What do you think?
I just saw that you already added tests, release note and changed the underlying repr. Thanks!
Do you have a particular reason to want to always serialize
EnumSet<T>
using anu128
, instead of using the existingSerialize
/Deserialize
for theEnumSet
's underlying representation?While this would cause the encoding to possibly change when adding variants with some encoders, it'd also make it far more compact with libraries like
bincode
and avoid serializing anu128
when possible. (You need thei128
feature inbincode
, for example.)I think using the underlying repr is the better approach, but I'm wondering about your use case.