Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement BufMut for
&mut [MaybeUninit<u8>]
This will allow using BufMut without having to initialise memory first. In particular, this will allow simple integration with tokio: #![feature(maybe_uninit_slice)] use tokio::io::AsyncSeekExt; let mut tokio_file = /* ... */; let mut buf = [MaybeUninit::uninit(); 4096]; let len = tokio_file.read_buf(&mut buf); // SAFETY: read above initialised first len bytes of the buffer. let buf = unsafe { MaybeUninit::slice_assume_init_mut(&buf[..len]) };
- Loading branch information