Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsafe code #1

Merged
merged 2 commits into from
Nov 26, 2019
Merged

Remove unsafe code #1

merged 2 commits into from
Nov 26, 2019

Conversation

nbraud
Copy link
Contributor

@nbraud nbraud 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
@nbraud nbraud 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