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

Method from_char

crates/common/src/format.rs:56–64  ·  view source on GitHub ↗
(c: CodePoint)

Source from the content-addressed store, hash-verified

54
55impl FormatConversion {
56 pub fn from_char(c: CodePoint) -> Option<Self> {
57 match c.to_char_lossy() {
58 's' => Some(Self::Str),
59 'r' => Some(Self::Repr),
60 'a' => Some(Self::Ascii),
61 'b' => Some(Self::Bytes),
62 _ => None,
63 }
64 }
65
66 fn from_string(text: &Wtf8) -> Option<Self> {
67 let mut chars = text.code_points();

Callers

nothing calls this directly

Calls 2

SomeClass · 0.50
to_char_lossyMethod · 0.45

Tested by

no test coverage detected