unsafe fn slice_insert<T>(slice: &mut [MaybeUninit<T>], idx: usize, val: T) {
    let len = slice.len();
    debug_assert!(len > idx);
    let slice_ptr = slice.as_mut_ptr();
    if len > idx + 1 {
        ptr::copy(slice_ptr.add(idx), slice_ptr.add(idx + 1), len - idx - 1);
    }
    (*slice_ptr.add(idx)).write(val);
}
/// Inserts a value into a slice of initialized elements followed by one uninitialized element.
///
/// # Safety
/// The slice has more than `idx` elements.
Inserts a value into a slice of initialized elements followed by one uninitialized element.
Inserts a value into a slice of initialized elements followed by one uninitialized element .
unsafe fn slice_insert<T>(slice: &mut [MaybeUninit<T>], idx: usize, val: T) {
    let len = slice.len();
    debug_assert!(len > idx);
    let slice_ptr = slice.as_mut_ptr();
    if len > idx + 1 {
        ptr::copy(slice_ptr.add(idx), slice_ptr.add(idx + 1), len - idx - 1);
    }
    (*slice_ptr.add(idx)).write(val);
}
unsafe fn slice_insert < T > ( slice : & mut [ MaybeUninit < T > ] , idx : usize , val : T ) { let len = slice . len ( ) ; debug_assert ! ( len idx ) ; let slice_ptr = slice . as_mut_ptr ( ) ; if len > idx + 1 { ptr :: copy ( slice_ptr . add ( idx ) , slice_ptr . add ( idx + 1 ) , len - idx - 1 ) ; } ( * slice_ptr . add ( idx ) ) . write ( val ) ; }
Inserts a value into a slice of initialized elements followed by one uninitialized element.
Inserts a value into a slice of initialized elements followed by one uninitialized element .
slice
&mut [MaybeUninit<T>]
idx
usize
val
T
slice
&mut [MaybeUninit<T>]
idx
usize
val
T
safety
The slice has more than `idx` elements.
The slice has more than ` idx ` elements .