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

Method can_encode

crates/common/src/str.rs:48–54  ·  view source on GitHub ↗
(&self, code: CodePoint)

Source from the content-addressed store, hash-verified

46
47 #[inline(always)]
48 pub fn can_encode(&self, code: CodePoint) -> bool {
49 match self {
50 Self::Ascii => code.is_ascii(),
51 Self::Utf8 => code.to_char().is_some(),
52 Self::Wtf8 => true,
53 }
54 }
55}
56
57pub trait DeduceStrKind {

Callers 1

encode_utf8_compatibleFunction · 0.80

Calls 2

is_asciiMethod · 0.45
to_charMethod · 0.45

Tested by

no test coverage detected