slice-copy 0.3.0

Go style copying for slices
Documentation

slice-copy

Build Status Crates.io Documentation

Go style copying for slices. For times where you would rather use the amount copied to adjust your slices as opposed to determining the amount to copy, adjusting your slices, and finally copying.

use slice_copy::copy;

let mut l = b"hello".to_vec();
let r = b"goodbye".to_vec();

let n = copy(&mut l, &r);

assert_eq!(n, 5);
assert_eq!(l, b"goodb");