Add uninit buffer ancillary APIs
Pretty sure I managed to maintain backcompat via a conversion trait.
Closes #1103
Nevermind, I don't think backcompat is possible without implementing a trait for both DerefMut<Target=[u8]> and DerefMut<Target=[MaybeUninit<u8>]> which I don't think you can do. Targeting the staging branch instead.
Staging needs a rebase and also https://github.com/bytecodealliance/rustix/issues/1107
Annnnnd I decided to make it backwards compatible again. The public API should be identical except there's now a From impl for MaybeUninit. 1.0 should break the ::new impl to take uninits instead.
Not sure why the tests are so borked.
Ok so the idea with this one is that the ::new methods would be swapped to use MaybeUninits for 1.0 and any way to construct a buffer with [u8] would be removed. I'm not really happy with the deprecation story as it feels like we'll just be springing this change on people, but I also don't see a way to allow seamless migration while preserving the name new.
I've now rebased this and fixed the merge conflicts.
Can we remove the non MaybeUninit versions? I personally don't think you should be using u8s for these buffers since we take care of giving you a nice well typed iterator.
Yep, I was just reading your comment above about that too.
Brilliant, this looks great!
Thanks!