pub fn clone_into_maybe_uninit_slice<'a, T>(
    src: &[T],
    dst: &'a mut [MaybeUninit<T>]
) -> &'a mut [T]where
    T: Clone,
Expand description

Clones the elements from src to dst, returning a mutable reference to the now initialized contents of dst. Any already initialized elements will not be dropped.

If T implements Copy, use copy_into_maybe_uninit_slice

This is similar to slice::clone_from_slice but does not drop existing elements. This is identical to the implementation of the method write_to_slice_cloned on MaybeUninit, but that API is as yet unstable.

Panics

This function will panic if the two slices have different lengths, or if the implementation of Clone panics.

If there is a panic, the already cloned elements will be dropped.