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

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

Merged
merged 1 commit into from Oct 11, 2019

Conversation

@lzutao
Copy link
Contributor

commented Sep 28, 2019

Closes #48784
r? @SimonSapin

@lzutao

This comment was marked as outdated.

Copy link
Contributor Author

commented Sep 28, 2019

@rustbot modify labels: needs-fcp

@rustbot

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2019

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

This comment has been minimized.

Copy link

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.

@sfackler

This comment has been minimized.

Copy link
Member

commented Sep 28, 2019

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

@SimonSapin

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2019

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

@SimonSapin

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2019

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

@rfcbot

This comment has been minimized.

Copy link

commented Sep 30, 2019

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

@lzutao lzutao force-pushed the lzutao:stabilize-repeat_generic_slice branch from 3ebdd91 to 4a2ae45 Oct 2, 2019
@yodaldevoid

This comment has been minimized.

Copy link
Contributor

commented Oct 3, 2019

@SimonSapin Did you mean to say Copy: Clone?

@rfcbot

This comment has been minimized.

Copy link

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.

@lzutao

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

@yodaldevoid Err, yes

@SimonSapin

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

@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

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

📌 Commit 4a2ae45 has been approved by SimonSapin

@bors

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

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

@bors bors added the merged-by-bors label Oct 11, 2019
@bors bors merged commit 4a2ae45 into rust-lang:master Oct 11, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20191002.10 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
@lzutao lzutao deleted the lzutao:stabilize-repeat_generic_slice branch Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.