Skip to content

Use .copy_from_slice() where applicable #31914

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

Merged
merged 1 commit into from
Feb 27, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Feb 26, 2016

Use .copy_from_slice() where applicable

.copy_from_slice() does the same job of .clone_from_slice(), but the
former is explicitly for Copy elements and calls memcpy directly, and
thus is it efficient without optimization too.

.copy_from_slice() does the same job of .clone_from_slice(), but the
former is explicitly for Copy elements and calls `memcpy` directly, and
thus is it efficient without optimization too.
@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@bluss
Copy link
Member Author

bluss commented Feb 26, 2016

cc @ubsan FYI

@alexcrichton
Copy link
Member

@bors: r+ 2d6496d

@bluss
Copy link
Member Author

bluss commented Feb 26, 2016

Thanks :) The I/O impls are back where they should be with this.

@strega-nil
Copy link
Contributor

@bluss thanks :)

bors added a commit that referenced this pull request Feb 27, 2016
Use .copy_from_slice() where applicable

.copy_from_slice() does the same job of .clone_from_slice(), but the
former is explicitly for Copy elements and calls `memcpy` directly, and
thus is it efficient without optimization too.
@bors
Copy link
Collaborator

bors commented Feb 27, 2016

⌛ Testing commit 2d6496d with merge f1e191c...

@bors bors merged commit 2d6496d into rust-lang:master Feb 27, 2016
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.

5 participants