MCPcopy Index your code
hub / github.com/RustPython/RustPython / char_to_decimal

Function char_to_decimal

crates/common/src/str.rs:646–651  ·  view source on GitHub ↗
(ch: char)

Source from the content-addressed store, hash-verified

644];
645
646pub fn char_to_decimal(ch: char) -> Option<u8> {
647 UNICODE_DECIMAL_VALUES
648 .binary_search(&ch)
649 .ok()
650 .map(|i| (i % 10) as u8)
651}
652
653#[cfg(test)]
654mod tests {

Callers 1

float_from_stringFunction · 0.85

Calls 2

okMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected