-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: Stabilize more of the char
module
#23126
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon |
b0862e5
to
6d6cbbd
Compare
Does "stable" mean we can still change their behavior after 1.0? |
I believe that we reserve the right to update the unicode standard we're using, which can add new case mappings for existing characters. Along those lines, I see actually parsing the extra data and returning many characters as a similar enhancement. All in all yes, I believe that this is a change we can make after 1.0 |
/// | ||
/// If the buffer is not large enough, nothing will be written into it | ||
/// and a `None` will be returned. | ||
/// In both of these examples, 'ß' takes one byte to encode. |
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.
one u16
6d6cbbd
to
d33b308
Compare
Pushed some updates, thanks for the comments @tbu- and @SimonSapin! |
LGTM. |
@bors: r+ d33b308 |
Note: this closes #20333 |
Returning |
@SimonSapin Oh, I agree, but I still take this to be addressing the underlying issue of that bug. |
My message was a long way of saying “+1” :) |
⌛ Testing commit d33b308 with merge e840e74... |
💔 Test failed - auto-linux-32-opt |
d33b308
to
e74a79a
Compare
@bors: r+ |
|
@bors: r=aturon |
|
⌛ Testing commit e74a79a with merge fde1502... |
💔 Test failed - auto-win-32-opt |
e74a79a
to
3bcd209
Compare
@bors: r=aturon 3bcd209 |
This commit performs another pass over the `std::char` module for stabilization. Some minor cleanup is performed such as migrating documentation from libcore to libunicode (where the `std`-facing trait resides) as well as a slight reorganiation in libunicode itself. Otherwise, the stability modifications made are: * `char::from_digit` is now stable * `CharExt::is_digit` is now stable * `CharExt::to_digit` is now stable * `CharExt::to_{lower,upper}case` are now stable after being modified to return an iterator over characters. While the implementation today has not changed this should allow us to implement the full set of case conversions in unicode where some characters can map to multiple when doing an upper or lower case mapping. * `StrExt::to_{lower,upper}case` was added as unstable for a convenience of not having to worry about characters expanding to more characters when you just want the whole string to get into upper or lower case. This is a breaking change due to the change in the signatures of the `CharExt::to_{upper,lower}case` methods. Code can be updated to use functions like `flat_map` or `collect` to handle the difference. [breaking-change]
3bcd209
to
0f6a0b5
Compare
This commit performs another pass over the `std::char` module for stabilization. Some minor cleanup is performed such as migrating documentation from libcore to libunicode (where the `std`-facing trait resides) as well as a slight reorganiation in libunicode itself. Otherwise, the stability modifications made are: * `char::from_digit` is now stable * `CharExt::is_digit` is now stable * `CharExt::to_digit` is now stable * `CharExt::to_{lower,upper}case` are now stable after being modified to return an iterator over characters. While the implementation today has not changed this should allow us to implement the full set of case conversions in unicode where some characters can map to multiple when doing an upper or lower case mapping. * `StrExt::to_{lower,upper}case` was added as unstable for a convenience of not having to worry about characters expanding to more characters when you just want the whole string to get into upper or lower case. This is a breaking change due to the change in the signatures of the `CharExt::to_{upper,lower}case` methods. Code can be updated to use functions like `flat_map` or `collect` to handle the difference. [breaking-change] Closes #20333
This commit performs another pass over the
std::char
module for stabilization.Some minor cleanup is performed such as migrating documentation from libcore to
libunicode (where the
std
-facing trait resides) as well as a slightreorganiation in libunicode itself. Otherwise, the stability modifications made
are:
char::from_digit
is now stableCharExt::is_digit
is now stableCharExt::to_digit
is now stableCharExt::to_{lower,upper}case
are now stable after being modified to returnan iterator over characters. While the implementation today has not changed
this should allow us to implement the full set of case conversions in unicode
where some characters can map to multiple when doing an upper or lower case
mapping.
StrExt::to_{lower,upper}case
was added as unstable for a convenience of nothaving to worry about characters expanding to more characters when you just
want the whole string to get into upper or lower case.
This is a breaking change due to the change in the signatures of the
CharExt::to_{upper,lower}case
methods. Code can be updated to use functionslike
flat_map
orcollect
to handle the difference.[breaking-change]
Closes #20333