copy_in_place
This crate provides a single function, a safe wrapper around ptr::copy
for efficient copying within slices.
Note: As of Rust 1.37, the standard library provides the equivalent
copy_within
method on slices. This crate is only useful for projects that need to
support older versions of Rust.
Examples
Copying four bytes within a slice:
let mut bytes = *b"Hello, World!";
copy_in_place;
assert_eq!;