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

Function len_utf8

crates/wtf8/src/core_char.rs:20–27  ·  view source on GitHub ↗
(code: u32)

Source from the content-addressed store, hash-verified

18#[inline]
19#[must_use]
20pub const fn len_utf8(code: u32) -> usize {
21 match code {
22 ..MAX_ONE_B => 1,
23 ..MAX_TWO_B => 2,
24 ..MAX_THREE_B => 3,
25 _ => 4,
26 }
27}
28
29#[inline]
30#[must_use]

Callers 2

len_wtf8Method · 0.85
encode_utf8_rawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected