-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 split_inclusive #77858
Stabilize split_inclusive #77858
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @withoutboats (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks @ijackson! We do have quite a lot of I think an API that might untangle things in the future could be to introduce something like a // do:
s.splitter(pat).inclusive()
s.rsplitter(pat).inclusive()
// instead of:
s.split_inclusive(pat)
s.rsplit_inclusive(pat) If we did want to do something like that and deprecate methods on |
These seem like reasonable additions to our @rfcbot fcp merge |
Team member @KodrAus 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. |
☔ The latest upstream changes (presumably #79895) made this pull request unmergeable. Please resolve the merge conflicts. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Closes rust-lang#72360. Signed-off-by: Ian Jackson <[email protected]>
4817ea2
to
be226e4
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
Signed-off-by: Ian Jackson <[email protected]>
@rustbot modify labels -S-waiting-on-author |
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. |
@bors r+ |
📌 Commit 5584224 has been approved by |
☀️ Test successful - checks-actions |
This was fixed before merging: 5584224 |
Contents of this MR
This stabilises:
slice::split_inclusive
slice::split_inclusive_mut
str::split_inclusive
Closes #72360.
A possible concern
The proliferation of
split_*
methods is not particularly pretty. The existence ofsplit_inclusive
seems to invite the addition ofrsplit_inclusive
,splitn_inclusive
, etc. We could instead have a more general API, along these kinds of lines maybe:But maybe that is worse.
Let us defer that?
This seems like a can of worms. I think we can defer opening it now; if and when we have something more general, these two methods can become convenience aliases. But I thought I would mention it so the lang API team can consider it and have an opinion.