dzamlo / rust-bitfield

This crate provides macros to generate bitfield-like struct.
Apache License 2.0
157 stars 19 forks source link

Easily Derive Bitwise Operations #44

Closed PokeJofeJr4th closed 2 months ago

PokeJofeJr4th commented 2 months ago

This pull request will extend the macro syntax with optional lines of the form impl BitOr; to generate basic implementations for the common bitwise operators.

dzamlo commented 2 months ago

Very nice piece of code!

The only thing missing is some mention in the documentation.

PokeJofeJr4th commented 2 months ago

I'm not sure if I made the right call merging the assignment versions of the operators. Should we plan for a case where someone would want to derive BitAnd but not BitAndAssign?

PokeJofeJr4th commented 2 months ago

FYI other than that, and a version increment, I believe this is ready to merge

dzamlo commented 2 months ago

I think you made the right call. I will release a new version with your changes ASAP.

dzamlo commented 2 months ago

Released as v0.16.0