-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std::ascii: Provide a copyless [Ascii] -> str method. #10333
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
Replacing
I originally added the The true fix here would be to have an
But because that's not possible yet, I'd keep |
There is no mention of
This is actually keeping it, just converting it to be (I agree that having a proper ascii string is the "correct" fix.) |
Sorry about the confusion, I misunderstood a few things. :) What I wanted to say is this: Giving However, seeing how the proper fix of having an ascii string type would allow to consistently implement both (Also, I think I introduced the |
Ah, one more thing: While you're changing stuff in the |
This renames to_str_ascii to as_str_ascii and makes it non-copying, which is possible now that strings no longer have a hidden extra byte/null terminator. Fixes rust-lang#6120.
This renames to_str_ascii to as_str_ascii and makes it non-copying, which is possible now that strings no longer have a hidden extra byte/null terminator. Fixes #6120.
…=flip1995 lintcheck: fix clap panic clap 4.1.4 panics if `-` is used at the start of an argument: ``` $ cargo lintcheck […] thread 'main' panicked at 'Argument recursive: long "--recursive" must not start with a `-`, that will be handled by the parser', /home/sam/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/clap-4.1.4/src/builder/debug_asserts.rs:82:13 ``` changelog: none <!-- changelog_checked -->
This renames to_str_ascii to as_str_ascii and makes it non-copying,
which is possible now that strings no longer have a hidden extra
byte/null terminator.
Fixes #6120.