-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: std::ascii reform #486
Conversation
By the way, I created starting point of the rust-ascii repository by running this command on a clone of the Rust repository:
(The second command gets rid of the empty merge commits.) |
CC @Kimundi (original author of the module) |
I don't mind in particular if this moves to a cargo package, but I'm a bit weary about cluttering |
@Kimundi regarding cluttering |
No, please not free functions :) I just think that the current situation where those functions are defined on the |
The obvious problem with the |
+1 for simplifying Rust's string story! Having one less char/string related type in std would have saved me significant time while learning rust. Could you get rid of char next? Coming from C I assumed it was 8 bits. If it were upper-cased, I might suspect it was some newfangled variable-length character type, but I find a lowercase 32 bit char type very surprising. |
People are often confused about 'char,' it's true. Very common IRC question. |
What the |
I am wholly in favor of this proposal; the Ascii type is pretty clearly not carrying its weight, but the case conversion/testing functionality is important to provide in |
@aturon, any opinion on the unresolved questions? |
Leave
Actually, it seems plausible to merge these traits.
I would lean toward "no", but we are planning to do a separate prelude stabilization so it doesn't matter for now.
Yes, as of today that's correct.
Depends somewhat on the prelude question; if it's not in the prelude, then probably all of the ones that have been marked |
|
In #503 (Stabilize std::prelude)
So the naming convention here is that a Given the above, |
Good one @SimonSapin. |
Good point; we can keep these separate.
I think |
Generally speaking, it seems like the stakeholders on this topic are satisfied with the design, as is the core team; this will simplify our string story, and follow the same pattern we're moving toward with unicode (where more advanced functionality lives in the Caroverse). Thanks for proposing this, @SimonSapin! I'm going to merge this RFC. @SimonSapin, you want to turn your branch into a PR? |
Implements [RFC 486](rust-lang/rfcs#486). Fixes #19908. * Rename `to_ascii_{lower,upper}` to `to_ascii_{lower,upper}case`, per #14401 * Remove the `Ascii` type and associated traits: `AsciiCast`, `OwnedAsciiCast`, `AsciiStr`, `IntoBytes`, and `IntoString`. * As a replacement, add `.is_ascii()` to `AsciiExt`, and implement `AsciiExt` for `u8` and `char`. [breaking-change]
Implements [RFC 486](rust-lang/rfcs#486). Fixes #19908. * Rename `to_ascii_{lower,upper}` to `to_ascii_{lower,upper}case`, per #14401 * Remove the `Ascii` type and associated traits: `AsciiCast`, `OwnedAsciiCast`, `AsciiStr`, `IntoBytes`, and `IntoString`. * As a replacement, add `.is_ascii()` to `AsciiExt`, and implement `AsciiExt` for `u8` and `char`. [breaking-change]
Move the
std::ascii::Ascii
type and related traits to a new Cargo package on crates.io, and instead expose its functionality foru8
,[u8]
,char
, andstr
types.Rendered