Open
Description
Add a function:
impl<T> MaybeUninit<T> {
pub fn fill_slice<'a>(this: &'a mut [MaybeUninit<T>], src: T) -> &'a mut [T]
where T: Clone,
{ ... }
}
Similarly to slice::fill
, it allows fast write of the same element to the slice.
Similarly to MaybeUninit::write_slice_cloned
, it returns initialized slice without unsafe code.