Open AaronKutch opened 5 years ago
I was also already thinking about this and also to use other things such as MaybeUninit
, ManuallyDrop
. I think apint
could make use a lot more of those new abstractions.
Yeah. I learned a bunch about manipulating pointers and using MaybeUninit
when working on my ptr_rotate
PR, so I will do this.
I was considering replacing BitWidth
altogether with NonZeroUsize
, but I have decided to keep it as a wrapper type around a NonZeroUsize
. I found it unlikely that we would use unused bits in the len
, but someone might want to clone the library and use NonZeroU32
or something else special.
The compiler has special optimizations for this. In fact, I might just replace
BitWidth
altogether, but I will have to try that in an experimental branch in the future.