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

Function len_utf16

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

Source from the content-addressed store, hash-verified

29#[inline]
30#[must_use]
31const fn len_utf16(code: u32) -> usize {
32 if (code & 0xFFFF) == code { 1 } else { 2 }
33}
34
35/// Encodes a raw `u32` value as UTF-8 into the provided byte buffer,
36/// and then returns the subslice of the buffer that contains the encoded character.

Callers 1

encode_utf16_rawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected