This branch replaces some boilerplate implementations of FromBits for enum types with the enum_from_bits! macro added to mycelium-bitfield in #450.
I didn't touch a couple manual FromBits implementations. Some parts of mycelium-pci manually implement FromBits in order to return a custom error type, so I left those alone. A few places in maitake use manual implementations for enums that cover all possible 2-bit bit patterns, so that the error arm can be unreachable_unchecked!. I didn't touch those either, since the perf delta may actually matter in those cases.
Depends on #450.
This branch replaces some boilerplate implementations of
FromBits
for enum types with theenum_from_bits!
macro added tomycelium-bitfield
in #450.I didn't touch a couple manual
FromBits
implementations. Some parts ofmycelium-pci
manually implementFromBits
in order to return a custom error type, so I left those alone. A few places inmaitake
use manual implementations for enums that cover all possible 2-bit bit patterns, so that the error arm can beunreachable_unchecked!
. I didn't touch those either, since the perf delta may actually matter in those cases.