It would be handful to have safe version of ptr::copy. I think that this one:
fn copy<T: Copy>(src: &[T], dst: &mut [T]) {
assert!(src.len() <= dst.len());
unsafe { ptr::copy(src.as_ptr(), dst.as_mut_ptr(), src.len()); }
}
Would be perfectly safe and handful.
PS:
I know that we can use loop but sometimes loop wasn’t be optimised out. Also I think that slice::copy(a, b) is more straightforward than:
for (src, dst) in src.iter().zip(&mut dst) {
*dst = *src
}