-
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
std: Deprecate the str::CharRange
type
#23268
Conversation
This struct and the associated functions `char_range_at` and `char_range_at_reverse` have been unstable for some time now, and it looks like with a combination of `char_at` plus `char_at_reverse` plus `len_utf8` that the structure isn't necessary at this time. The structure and perhaps more fanciful unicode processing support could be added at a later date, but for now the types are being deprecated and slated for removal. Any code currently using `CharRange` can instead use the `char_at` and `char_at_reverse` methods plus the `len_utf8` method on `char` as a replacement. Closes rust-lang#9387 [breaking-change]
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon (but feel free to reassign as I keep piling things on you...) |
I'm curious about the rationale for this decision instead of, for example, deprecating |
Honestly I didn't really give it too much consideration, I figured we were going to stabilize I'd have to do some benchmarking to see if recomputing the length actually matters that much, I suspect that "performance critical" use cases should be using |
OK, if you see FWIW, though, I don't think we need to deprecate all unstable APIs that we don't plan to ship in 1.0. It's fine for some stuff to sit as unstable, and garner support from the nightly crowd in terms of eventual stabilization. |
Yeah that's a good point, I also wouldn't mind just leaving this as |
Closing in favor of #23461 |
This struct and the associated functions
char_range_at
andchar_range_at_reverse
have been unstable for some time now, and it looks likewith a combination of
char_at
pluschar_at_reverse
pluslen_utf8
that thestructure isn't necessary at this time.
The structure and perhaps more fanciful unicode processing support could be
added at a later date, but for now the types are being deprecated and slated for
removal.
Any code currently using
CharRange
can instead use thechar_at
andchar_at_reverse
methods plus thelen_utf8
method onchar
as a replacement.Closes #9387
[breaking-change]