Skip to content

Stabilize slice::repeat (feature repeat_generic_slice) #64877

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Sep 28, 2019

Closes #48784
r? @SimonSapin

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 28, 2019
@jonas-schievink jonas-schievink added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 28, 2019
@jonas-schievink jonas-schievink added this to the 1.40 milestone Sep 28, 2019
@jonas-schievink jonas-schievink added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 28, 2019
@tesuji

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Sep 28, 2019

Error: Label needs-fcp can only be set by Rust team members

Please let @rust-lang/release know if you're having trouble with this bot.

@SimonSapin
Copy link
Contributor

Signature:

impl<T> [T] {
    pub fn repeat(&self, n: usize) -> Vec<T> where T: Copy {}
}

Would we want to add a variation of this with Clone instead of Copy? If so what would the naming scheme be?

@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 28, 2019

Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 28, 2019
@sfackler
Copy link
Member

I think we'd just have a single method with internal specialization for T: Copy.

@SimonSapin
Copy link
Contributor

In that case the signature to stabilize is not this one.

@SimonSapin
Copy link
Contributor

SimonSapin commented Sep 28, 2019

Oh never mind, I forgot that Clone: Copy Copy: Clone so it should be fine to extend this later.

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Sep 30, 2019
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 30, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Sep 30, 2019
@tesuji tesuji force-pushed the stabilize-repeat_generic_slice branch from 3ebdd91 to 4a2ae45 Compare October 2, 2019 04:48
@yodaldevoid
Copy link
Contributor

@SimonSapin Did you mean to say Copy: Clone?

@rfcbot
Copy link
Collaborator

rfcbot commented Oct 10, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 10, 2019
@tesuji
Copy link
Contributor Author

tesuji commented Oct 11, 2019

I have one question: Can we make it like Python itertools::cycle function?
Which mean this slice::repeat function could return an iterator instead?
Should we rename it to slice::cycle instead?

@SimonSapin
Copy link
Contributor

@yodaldevoid Err, yes

@SimonSapin
Copy link
Contributor

@lzutao We already have a cycle method on all iterators that implement Clone (which includes slice::Iter), though that one returns an infinite iterator.

@SimonSapin
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 11, 2019

📌 Commit 4a2ae45 has been approved by SimonSapin

@bors bors 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 Oct 11, 2019
@bors
Copy link
Collaborator

bors commented Oct 11, 2019

⌛ Testing commit 4a2ae45 with merge 6767d9b...

bors added a commit that referenced this pull request Oct 11, 2019
…Sapin

Stabilize `slice::repeat` (feature `repeat_generic_slice`)

Closes #48784
r? @SimonSapin
@bors
Copy link
Collaborator

bors commented Oct 11, 2019

☀️ Test successful - checks-azure
Approved by: SimonSapin
Pushing 6767d9b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 11, 2019
@bors bors merged commit 4a2ae45 into rust-lang:master Oct 11, 2019
@tesuji tesuji deleted the stabilize-repeat_generic_slice branch October 12, 2019 01:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repeat method for (byte) slices?
9 participants