mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
f639657fe4
Use `copy_nonoverlapping` to copy `bytes` in `String::insert_bytes` The second copy could be made using `ptr::copy_nonoverlapping` instead of `ptr::copy`, since aliasing won't allow `self` and `bytes` to overlap. LLVM even seems to recognize this, [replacing the second `memmove` with a `memcopy`](https://rust.godbolt.org/z/Yoaa6rrGn), so this makes it so it's always applied. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |