lexical_util::digit

Function char_to_digit_const

Source
pub const fn char_to_digit_const(c: u8, radix: u32) -> Option<u32>
Expand description

Convert a character to a digit with a radix known at compile time.

This optimizes for cases where radix is <= 10, and uses a decent, match-based fallback algorithm.