Skip to content

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

Open
@dhardy

Description

@dhardy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-APIBreakage: APIP-postponeWaiting on something else

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions