Skip to content

Improve documentation for slice swap/copy/clone operations. - #46219

Merged
bors merged 1 commit into
masterfrom
frewsxcv-issue-45636
Nov 29, 2017
Merged

Improve documentation for slice swap/copy/clone operations.#46219
bors merged 1 commit into
masterfrom
frewsxcv-issue-45636

Conversation

@frewsxcv

Copy link
Copy Markdown
Contributor

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

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @BurntSushi

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

Comment threadsrc/liballoc/slice.rs Outdated
///
/// {
/// let (left, right) = slice.split_at_mut(2);
/// left[..2].swap_with_slice(&mut right[1..]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the [..2] here is now redundant, I think it's best to remove it.

Comment threadsrc/liballoc/slice.rs Outdated
///
/// {
/// let (left, right) = slice.split_at_mut(2);
/// left[..2].copy_from_slice(&right[1..]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@bors

bors commented Nov 24, 2017

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #46225) made this pull request unmergeable. Please resolve the merge conflicts.

@kennytmkennytm added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 24, 2017
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`
@frewsxcv

Copy link
Copy Markdown
ContributorAuthor

@bluss comments addressed in the latest force push

@kennytmkennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 24, 2017
@frewsxcv

Copy link
Copy Markdown
ContributorAuthor

r? @rust-lang/docs

@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks!

@bors: r+ rollup

@bors

bors commented Nov 28, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 1ad38f2 has been approved by GuillaumeGomez

@kennytmkennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2017
@bors

bors commented Nov 29, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1ad38f2 with merge b17670b20f9caaf6ff18badc020d0275015e4503...

@bors

bors commented Nov 29, 2017

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@kennytm

Copy link
Copy Markdown
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`
@kennytmkennytm mentioned this pull request Nov 29, 2017
bors added a commit that referenced this pull request Nov 29, 2017
Rollup of 10 pull requests
- Successful merges: #45969, #46077, #46219, #46287, #46293, #46322, #46323, #46330, #46354, #46356
- Failed merges:
@bors
bors merged commit 1ad38f2 into masterNov 29, 2017
@GuillaumeGomez
GuillaumeGomez deleted the frewsxcv-issue-45636 branch November 29, 2017 15:23
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@frewsxcv@rust-highfive@bors@GuillaumeGomez@kennytm@bluss@BurntSushi