pub fn remove(&mut self, index: usize) -> Option<T> {
        if index >= self.len {
            return None;
        }
        let target_ptr = &mut self.inner_mut().body[index] as *mut MaybeUninit<T>;
        let val = unsafe { ptr::read(target_ptr) };
        let copy_len = self.len - index - 1;
        let copy_src = unsafe { target_ptr.add(1) };
        unsafe { ptr::copy(copy_src, target_ptr, copy_len) };
        unsafe { self.shrink(self.len - 1) };
        self.len -= 1;
        Some(unsafe { val.assume_init() })
    }
/// Removes a value at the given index, if it exiss.
/// All entries after `index` will be shifted to the left.
Removes a value at the given index, if it exiss.
All entries after `index` will be shifted to the left.
Removes a value at the given index if it exiss . All entries after ` index ` will be shifted to the left .
pub fn remove(&mut self, index: usize) -> Option<T> {
        if index >= self.len {
            return None;
        }
        let target_ptr = &mut self.inner_mut().body[index] as *mut MaybeUninit<T>;
        let val = unsafe { ptr::read(target_ptr) };
        let copy_len = self.len - index - 1;
        let copy_src = unsafe { target_ptr.add(1) };
        unsafe { ptr::copy(copy_src, target_ptr, copy_len) };
        unsafe { self.shrink(self.len - 1) };
        self.len -= 1;
        Some(unsafe { val.assume_init() })
    }
pub fn remove ( & mut self , index : usize ) -> Option < T > { if index >= self . len { return None ; } let target_ptr = & mut self . inner_mut ( ) . body [ index ] as * mut MaybeUninit < T > ; let val = unsafe { ptr :: read ( target_ptr ) } ; let copy_len = self . len - index - 1 ; let copy_src = unsafe { target_ptr . add ( 1 ) } ; unsafe { ptr :: copy ( copy_src , target_ptr , copy_len ) } ; unsafe { self . shrink ( self . len - 1 ) } ; self . len -= 1 ; Some ( unsafe { val . assume_init ( ) } ) }
Removes a value at the given index, if it exiss.
Removes a value at the given index if it exiss .
&mut self
index
usize