-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Rename slice::take... methods to split_off...
#136555
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
Conversation
|
Discussion for reference https://hackmd.io/xLRjfOA4Twy3_nEzXv7gcQ#nominated-rusttf62280-Tracking-issue-for-slice_take. I'll take a look soon. |
dtolnay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
@bors r+ |
| /// | ||
| /// This is a helper function for `take` and `take_mut` that returns | ||
| /// the direction of the split (front or back) as well as the index at | ||
| /// which to split. Returns `None` if the split index would overflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, you missed the take and take_mut in this comment (not able to be shown in the snippet).
This rename was discussed and recommended in a recent t-libs meeting.
cc #62280
There's an additional commit here which modifies internals of unstable
OneSidedRangeAPIs in order to implementsplit_offmethods in a panic-free way (removeunreachable!()) as recommended in https://github.com/rust-lang/rust/pull/88502/files#r760177240. I can split this out into a separate PR if needed.