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

Return the delimiter from slice::split_once #119799

Conversation

Benjamin-L
Copy link
Contributor

This is a breaking change to the unstable slice_split_once feature. It was originally proposed in #112811 (comment).

This would be a departure from the str::split_once API that the slice_split_once methods were based on. The justification is that for arbitrary T, the split element and be complex and the relationship between the split element and the predicate can be more indirect than with typical str patterns.

This is a departure from the str::split_once API that the slice methods
were based on. The justification is that for arbitrary T, the split
element and be complex and the relationship between the split element
and the predicate can be more indirect than with typical str patterns.
@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2024

r? @cuviper

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 10, 2024
@Benjamin-L Benjamin-L marked this pull request as draft January 10, 2024 19:00
@Benjamin-L
Copy link
Contributor Author

Marking this as a draft, since there was another good proposal for the api here: #112811 (comment).

@cuviper
Copy link
Member

cuviper commented Jan 10, 2024

I think we'll need an API member to weigh in on this.

@rustbot label -T-libc +T-libs-api
r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jan 10, 2024
@rustbot rustbot assigned joshtriplett and unassigned cuviper Jan 10, 2024
@joshtriplett
Copy link
Member

r? libs-api

@rustbot rustbot assigned Amanieu and unassigned joshtriplett Feb 11, 2024
@ChrisDenton ChrisDenton added the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Mar 19, 2024
@Amanieu Amanieu removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Mar 20, 2024
@Amanieu
Copy link
Member

Amanieu commented Apr 2, 2024

We discussed this in a previous libs-api meeting.

Finding the delimiter in slices is relatively easy to do using slice.iter().position(...). As such, we view that changing the signature of slice::split_once is not worth the cost of losing API consistency with str::split_once.

On the other hand, str::split_once would gain value by returning the delimiter due to the flexibility in the kinds of patterns that are accepted by the API. It unfortunately can't be done since that API is already stable.

Perhaps a better avenue would be to explore a new API on str and then later port that API back to slice.

@Amanieu Amanieu removed the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Apr 2, 2024
@Amanieu
Copy link
Member

Amanieu commented Apr 2, 2024

@rfcbot fcp close

@rfcbot
Copy link

rfcbot commented Apr 2, 2024

Team member @Amanieu has proposed to close 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-close This PR / issue is in PFCP or FCP with a disposition to close it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Apr 2, 2024
@rfcbot
Copy link

rfcbot commented Apr 2, 2024

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

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Apr 12, 2024
@rfcbot
Copy link

rfcbot commented Apr 12, 2024

The final comment period, with a disposition to close, 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.

@Amanieu Amanieu closed this Apr 13, 2024
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-close This PR / issue is in PFCP or FCP with a disposition to close it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

None yet

8 participants