Uh oh!
There was an error while loading. Please reload this page.
Improve documentation for slice swap/copy/clone operations. - #46219
Merged
Conversation
rust-highfive
commented
Nov 23, 2017
Contributor
r? @BurntSushi (rust_highfive has picked a reviewer for you, use r? to override) |
bluss
reviewed
Nov 23, 2017
| /// | ||
| /// { | ||
| /// let (left, right) = slice.split_at_mut(2); | ||
| /// left[..2].swap_with_slice(&mut right[1..]); |
Contributor
There was a problem hiding this comment.
the [..2] here is now redundant, I think it's best to remove it.
bluss
reviewed
Nov 23, 2017
| /// | ||
| /// { | ||
| /// let (left, right) = slice.split_at_mut(2); | ||
| /// left[..2].copy_from_slice(&right[1..]); |
bors
commented
Nov 24, 2017
Collaborator
☔ The latest upstream changes (presumably #46225) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes#45636. - Demonstrate how to use these operations with slices of differing lengths - Demonstrate how to swap/copy/clone sub-slices of a slice using `split_at_mut`
frewsxcvforce-pushed
the
frewsxcv-issue-45636
branch
from
November 24, 2017 15:09
f58e5e5 to
1ad38f2Comparefrewsxcv
commented
Nov 24, 2017
ContributorAuthor
@bluss comments addressed in the latest force push |
frewsxcv
commented
Nov 28, 2017
ContributorAuthor
r? @rust-lang/docs |
GuillaumeGomez
commented
Nov 28, 2017
Member
Thanks! @bors: r+ rollup |
bors
commented
Nov 28, 2017
Collaborator
📌 Commit 1ad38f2 has been approved by |
bors
commented
Nov 29, 2017
Collaborator
⌛ Testing commit 1ad38f2 with merge b17670b20f9caaf6ff18badc020d0275015e4503... |
bors
commented
Nov 29, 2017
Collaborator
💔 Test failed - status-travis |
kennytm
commented
Nov 29, 2017
Member
@bors retry — travis-ci/travis-ci#8821 |
kennytm added a commit
to kennytm/rust
that referenced
this pull request
Nov 29, 2017
…uillaumeGomez Improve documentation for slice swap/copy/clone operations. Fixesrust-lang#45636. - Demonstrate how to use these operations with slices of differing lengths - Demonstrate how to swap/copy/clone sub-slices of a slice using `split_at_mut`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#45636.
lengths
split_at_mut