copyinplace

RepoDocsCrate

This crate provides a single function, a safe wrapper around [ptr::copy] for efficient copying within slices. The goal is to eventually include this as a built-in method on slices in libcore ([PR #53652]).

Examples

Copying four bytes within a slice:

```rust let mut bytes = *b"Hello, World!";

copyinplace(&mut bytes, 1, 8, 4);

assert_eq!(&bytes, b"Hello, Wello!"); ```