Function konst::chr::from_u32_unchecked

source ·
pub const unsafe fn from_u32_unchecked(n: u32) -> char
Expand description

Unsafely coerces u32 to char, const equivalent of char::from_u32_unchecked

§Safety

The input u32 must be within either of these ranges:

  • 0..=0xD7FF
  • 0xE000..=0x10FFFF

§Example

use konst::chr;

const AT: char = unsafe { chr::from_u32_unchecked(64) };

assert_eq!(AT, '@');