pub fn copy_in_place<T: Copy, R: RangeBounds<usize>>(
slice: &mut [T],
Copies elements from one part of a slice to another part of the same slice, using a memmove.
src is the range within the slice to copy from.
dest is the starting
index of the range within the slice to copy to, which will have the same
src. The two ranges may overlap. The ends of the two ranges must
be less than or equal to
This function will panic if either range exceeds the end of the slice, or if
the end of
src is before the start.
Copying four bytes within a slice:
let mut bytes = *b"Hello, World!"; copy_in_place(&mut bytes, 1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");