Skip to content

Conversation

nicoonoclaste
Copy link
Contributor

@nicoonoclaste nicoonoclaste commented Nov 26, 2019

When copying from different slices, std::slice::copy_from_slice is always
preferable: it implements bounds-checks, is safe, and also calls into memcpy.
slice::copy_within supports safely copying within a given slice,
and is implemented with std::ptr::copy.
@hucsmn
Copy link
Owner

hucsmn commented Nov 26, 2019

I have just noticed that slice::copy_within was stablized in rust 1.37.0 after this crate was done. It would be great to update those old unsafe slice copying codes to newer version.
Many thanks!

@hucsmn hucsmn merged commit 9392766 into hucsmn:master Nov 26, 2019
@nicoonoclaste nicoonoclaste deleted the safety-dance branch November 26, 2019 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants