You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
238 B

pub fn copy_slice<T,S,D>(mut dst: D, src: S) -> usize
where S: AsRef<[T]>,
D: AsMut<[T]>,
T: Clone
{
let mut sz=0;
for (d,s) in dst.as_mut().iter_mut().zip(src.as_ref().iter())
{
*d = s.clone();
sz+=1;
}
sz
}