Closed r12f closed 4 months ago
If you're interested, check out my overhaul project https://github.com/JonathanWoollett-Light/ux2 where this is implemented e.g. https://docs.rs/ux2/latest/ux2/struct.i10.html#associatedconstant.BITS.
@r12f (or @JonathanWoollett-Light) this makes sense to me and if you want to open a PR for this I'll review it. If not I'll probably take a look at adding it myself soon--I've needed this in a lib of mine that uses uX as well and ended up writing an extension trait for it, would be nice to have it in the lib.
Since 1.53.0, rust added the new constant
BITS
with type as u32, so it might be helpful to add it in uX crate as well for writing uniformed code.Should be a straight-forward change, hence I have forked the repo and created a branch here: https://github.com/r12f/uX/tree/add-bits. Please let me know, how it looks! And if it makes sense to you, I can send out the PR for update.