-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking issue for [T]::rsplit
and [T]::rsplit_mut
#41020
Comments
I don't think this improvement needs an RFC. It seems like Rsplit needs to use a distinct iterator type for encapsulation so that it can be distinct when subslice splitting finally comes around? |
OK, no RFC. Working on a patch. @bluss Is a feature flag needed for this? |
Yes, the usual way is that you invent a new feature name for it and introduce as unstable. |
OK, thanks. I don't need to add it to |
Correct, that's for language (this is library) feature gates. |
PR #41065. |
…excrichton [T]::rsplit() and rsplit_mut(), rust-lang#41020
[T]::rsplit
and [T]::rsplit_mut
[T]::rsplit
and [T]::rsplit_mut
This should not have been closed since it is the tracking issue for unstable APIs. |
By itself this API seems unnecessary to me as it is the same as This has been in nightly for 11 months without issue: @rfcbot fcp merge |
With proper labels… @rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), 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. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
stabilize a bunch of minor api additions besides `ptr::NonNull::cast` (which is 4 days away from end of FCP) all of these have been finished with FCP for a few weeks now with minimal issues raised * Closes #41020 * Closes #42818 * Closes #44030 * Closes #44400 * Closes #46507 * Closes #47653 * Closes #46344 the following functions will be stabilized in 1.27: * `[T]::rsplit` * `[T]::rsplit_mut` * `[T]::swap_with_slice` * `ptr::swap_nonoverlapping` * `NonNull::cast` * `Duration::from_micros` * `Duration::from_nanos` * `Duration::subsec_millis` * `Duration::subsec_micros` * `HashMap::remove_entry`
Update (@SimonSapin): this is now a tracking issue for methods implemented in #41065.
In @brson's tech review of Programming Rust, when he got to the bit where we list all the slice methods, he wrote: "What about 'rsplit' (no 'n')?"
I thought, oh no, I missed a method. But there really isn't a
[T]::rsplit
method!Slices don't have
.rsplit(p)
, I guess maybe because.split(p).rev()
does exactly what.rsplit(p)
would do. (The two are subtly different for strings, in cases where the pattern can have overlapping matches.)But is that a good enough reason to "break symmetry"?
@brson either really expected
rsplit
to exist, or he was speaking up for a hypothetical reader, new to Rust, who might expect it. Either way, I think it should be added, just to reduce by 1 the number of curious wrinkles in libcore. I'll write an RFC if this seems reasonable.The text was updated successfully, but these errors were encountered: