Constant std::char::MAX

1.0.0 · source · []
pub const MAX: char = char::MAX; // '\u{10ffff}'
Expand description

The highest valid code point a char can have, '\u{10FFFF}'.

Examples

let c: char = something_which_returns_char();
assert!(c <= char::MAX);

let value_at_max = char::MAX as u32;
assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
assert_eq!(char::from_u32(value_at_max + 1), None);
Run