12 Commits

Author SHA1 Message Date
Chai T. Rex
d811581ba7 Add std::ascii::Char MIN and MAX constants 2025-08-05 15:03:11 -04:00
Chai T. Rex
9a1d38047f Add u8-as-ASCII methods to core::ascii::Char 2025-08-05 15:02:41 -04:00
Evgenii Zheltonozhskii
3c76e3d002 Constify Try, From, TryFrom 2025-07-21 12:49:45 +03:00
Ben Kimock
e36dc78edd Add some track_caller info to precondition panics 2025-05-21 09:10:06 -04:00
Ben Kimock
84dacc1882 Add more precondition check tests 2024-10-09 19:34:27 -04:00
Chai T. Rex
191862d701 Use assert_unsafe_precondition! in AsciiChar::digit_unchecked 2024-08-21 16:26:35 -04:00
Michal Nazarewicz
7d1de7f994 core: optimise Debug impl for ascii::Char
Rather than writing character at a time, optimise Debug implementation
for core::ascii::Char such that it writes the entire representation as
with a single write_str call.

With that, add tests for Display and Debug implementations.
2024-08-09 22:50:57 +02:00
joseLuís
1c7ea307cf implement Default for AsciiChar 2024-02-13 12:04:44 +01:00
Michal Nazarewicz
abf45ae0b2 core: add From<core::ascii::char> implementations
Introduce `From<core::ascii::char>` implementations for all unsigned
numeric types and `char`.  This matches the API of `char` type.

Issue: https://github.com/rust-lang/rust/issues/110998
2024-01-25 16:09:16 +01:00
soqb
9c0e5ebf65 fix Debug impl for AsciiChar 2023-09-01 12:29:40 +01:00
Alyssa Haroldsen
a22b9bf2e6 Rename copying ascii::Char methods from as_ to to_
Tracking issue: #110998.

The [API guidelines][naming] describe `as` as used for
borrowed -> borrowed operations, and `to_` for
owned -> owned operations on `Copy` types.

[naming]: https://rust-lang.github.io/api-guidelines/naming.html
2023-08-08 16:03:47 -07:00
Scott McMurray
8c781b0906 Add the basic ascii::Char type 2023-05-03 22:09:33 -07:00