copy_in_place

Crates.iocopy_in_place
lib.rscopy_in_place
version0.2.2
sourcesrc
created_at2018-08-26 05:43:27.669635
updated_at2022-11-29 01:27:25.907633
description[deprecated] a safe wrapper around ptr::copy for efficient copying within slices
homepage
repositoryhttps://github.com/oconnor663/copy_in_place
max_upload_size
id81465
size6,766
Jack O'Connor (oconnor663)

documentation

https://docs.rs/copy_in_place

README

copy_in_place

RepoDocsCrate

This crate provides a single function, a safe wrapper around ptr::copy for efficient copying within slices.

DEPRECATED: As of Rust 1.37, the standard library provides the equivalent copy_within method on slices. This crate is deprecated, and it won't receive any further updates or fixes.

Examples

Copying four bytes within a slice:

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

copy_in_place(&mut bytes, 1..5, 8);

assert_eq!(&bytes, b"Hello, Wello!");
Commit count: 16

cargo fmt