Uh oh!
There was an error while loading. Please reload this page.
Implement Write trait for MaybeUninit<u8> - #94665
Conversation
rust-highfive
commented
Mar 6, 2022
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
c7ea1f2 to
f18a951CompareSUPERCILEX
commented
Mar 6, 2022
Fixed the benchmark and added one for MaybeUninit: |
m-ou-se
commented
Mar 9, 2022
I'm not sure if this is the right kind of API we want to provide for this. The guarantee that the written part is properly initialized and usable as |
SUPERCILEX
commented
Mar 9, 2022
Would it make sense to implement Write for |
JohnCSimon
commented
Apr 11, 2022
@SUPERCILEX |
SUPERCILEX
commented
Apr 11, 2022
I'm waiting on a reply to my above comment. |
JohnCSimon
commented
Apr 23, 2022
@m-ou-se ☝️ ? |
bors
commented
Jun 9, 2022
☔ The latest upstream changes (presumably #97910) made this pull request unmergeable. Please resolve the merge conflicts. |
JohnCSimon
commented
Jul 3, 2022
@m-ou-se - can you comment on this? |
SUPERCILEX
commented
Sep 30, 2022
This has been implemented in #97015. You can now do this: letmut buf = [MaybeUninit::<u8>::uninit();20];letmut buf:BorrowedBuf = buf.as_mut_slice().into();write!(buf.unfilled(),"{}",42).unwrap();let buf:&[u8] = buf.filled(); |
This PR makes it possible to write something like the following: