slice-copy 0.3.0

Go style copying for slices
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented3 out of 3 items with examples
  • Size
  • Source code size: 5.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 566.95 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • twmb/slice-copy
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • twmb

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");