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

Method compile_fstring_literal_value

crates/codegen/src/compile.rs:9420–9431  ·  view source on GitHub ↗
(
        &self,
        string: &ast::InterpolatedStringLiteralElement,
        flags: ast::FStringFlags,
    )

Source from the content-addressed store, hash-verified

9418 }
9419
9420 fn compile_fstring_literal_value(
9421 &self,
9422 string: &ast::InterpolatedStringLiteralElement,
9423 flags: ast::FStringFlags,
9424 ) -> Wtf8Buf {
9425 if string.value.contains(char::REPLACEMENT_CHARACTER) {
9426 let source = self.source_file.slice(string.range);
9427 crate::string_parser::parse_fstring_literal_element(source.into(), flags.into()).into()
9428 } else {
9429 string.value.to_string().into()
9430 }
9431 }
9432
9433 fn compile_fstring_part_literal_value(&self, string: &ast::StringLiteral) -> Wtf8Buf {
9434 if string.value.contains(char::REPLACEMENT_CHARACTER) {

Callers 1

Calls 4

to_stringMethod · 0.80
containsMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected