Robbepop / modular-bitfield

Macro to generate bitfields for structs that allow for modular use of enums.
Apache License 2.0
155 stars 40 forks source link

Fix incorrect popping which introduced extra bits #13

Closed crzysdrs closed 4 years ago

crzysdrs commented 4 years ago

There was another issue due to some incorrect shifting which introduced extra bits during the pop_bits routine.

crzysdrs commented 4 years ago

I would argue that the exhaustiveness is actually pretty worthwhile as it gives confidence of correctness for future modifications. It's pretty quick to cover 65536 values (even on my 5 year old pc). Running just that specific test:

$ time cargo run Finished dev [unoptimized + debuginfo] target(s) in 0.00s Running target/debug/fix_mod

real 0m0.097s user 0m0.094s sys 0m0.004s

Robbepop commented 4 years ago

Will merge once CI passed.

Robbepop commented 4 years ago

Thanks again for your incredible work! :)