Skip to content
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

CHANGE: use std::ascii::Char #1590

Open
dhardy opened this issue Feb 15, 2025 · 0 comments
Open

CHANGE: use std::ascii::Char #1590

dhardy opened this issue Feb 15, 2025 · 0 comments
Labels
B-API Breakage: API P-postpone Waiting on something else

Comments

@dhardy
Copy link
Member

dhardy commented Feb 15, 2025

std has a new, unstable, type: std::ascii:Char. This should get a corresponding impl Extend<ascii::Char> for String.

Alphanumeric (and soon Alphabetic #1587) sample u8 ASCII values since these are smaller than char and may be used to extend a String more efficiently, albeit unsafely. Switching these to ascii::Char (once stable) should give us a fast, safe alternative.

To keep type inference, we should replace the existing implementations of Distribution for these types. This is a breaking change (but an additional impl would also be breaking).

Alternative

We could (once impl Extend<ascii::Char> for String is available) switch to ascii::Char before the type is stabilized.

Motivation: allow us to release Rust v1.0 without expecting to make a breaking change here later.

@dhardy dhardy added B-API Breakage: API P-postpone Waiting on something else labels Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-API Breakage: API P-postpone Waiting on something else
Projects
None yet
Development

No branches or pull requests

1 participant