Skip to content

<ctype.h> functions for AsciiExt #39658

Closed
@zackw

Description

As discussed at https://internals.rust-lang.org/t/improvements-to-asciiext/4689 I have added is_ascii_* equivalents of most (not quite all) of C's ctype.h's isxxx functions to the AsciiExt trait.

The new functions are

  • is_ascii_alphabetic
  • is_ascii_uppercase
  • is_ascii_lowercase
  • is_ascii_alphanumeric
  • is_ascii_digit
  • is_ascii_hexdigit
  • is_ascii_punctuation
  • is_ascii_graphic
  • is_ascii_whitespace (matches the Infra Standard definition of ASCII whitespace, not POSIX)
  • is_ascii_control

They are implemented for char, u8, str, and [u8], and, for backward compatibility with external trait implementations, have default implementations that call unimplemented!().

PR to follow, but I needed to file this bug in order to get an issue number to put in the stability annotations.

Metadata

Assignees

No one assigned

    Labels

    B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions