modular-bitfield icon indicating copy to clipboard operation
modular-bitfield copied to clipboard

Add Specifier trait implementation for nonzero primitives

Open ollie-etl opened this issue 1 year ago • 2 comments

Adds Specifier trait implementations for non zero primitives, an Option types containing non-zero primitives This allows Option<NonZero<u16>> etc to be used in bitfield specification directly.

ollie-etl avatar Dec 03 '24 17:12 ollie-etl

This approach was chosen over the blanket implmentation for NonZero types

impl<T: Specifier + ZeroablePrimitive> Specifier for NonZero<T> {
  // ...
}

That approach requires the unstable language feature ZeroablePrimitive to be enabled, whereas the provided implementation works on stable

ollie-etl avatar Dec 03 '24 17:12 ollie-etl

Hi! I am going through and triaging old PRs. Are you still interested in working on this and would like a review? Thanks!

csnover avatar May 04 '25 06:05 csnover