How to copy content from one slice to another properly and optimally?
fn copy<'a, 'b, T>(src: &'a [T], dst: &'b [T]) {
assert!(src.len() == dst.len());
*dst = *src;
}
It is implied that both slices always have the same length.
How to copy content from one slice to another properly and optimally?
fn copy<'a, 'b, T>(src: &'a [T], dst: &'b [T]) {
assert!(src.len() == dst.len());
*dst = *src;
}
It is implied that both slices always have the same length.