Devlyn-Nelson / Bondrewd

Rust proc_macro library for bit level field packing.
7 stars 2 forks source link

Boolean values shouldn't shift when reading from bytes. #7

Closed Devlyn-Nelson closed 2 years ago

Devlyn-Nelson commented 2 years ago

in the Full Generated code section of the bondrewd-derive docs you can see a boolean being extracted the rotated right by 7, then compared to 0. Due to 0 having all zero bits, shifting is pointless.

Devlyn-Nelson commented 2 years ago

booleans no longer shift as of 0.3.6