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

Function u32_to_char

crates/stdlib/src/array.rs:577–580  ·  view source on GitHub ↗
(ch: u32)

Source from the content-addressed store, hash-verified

575 }
576
577 fn u32_to_char(ch: u32) -> Result<CodePoint, String> {
578 CodePoint::from_u32(ch)
579 .ok_or_else(|| format!("character U+{ch:4x} is not in range [U+0000; U+10ffff]"))
580 }
581
582 impl TryFrom<WideChar> for CodePoint {
583 type Error = String;

Callers 3

try_fromMethod · 0.85
_array_reconstructorFunction · 0.85

Calls 1

ok_or_elseMethod · 0.80

Tested by

no test coverage detected