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

Function push_template_str_literal

crates/vm/src/stdlib/_ast/string.rs:93–104  ·  view source on GitHub ↗
(
    output: &mut Vec<TemplateStrPart>,
    pending: &mut Option<(String, StringLiteralPrefix, TextRange)>,
)

Source from the content-addressed store, hash-verified

91}
92
93fn push_template_str_literal(
94 output: &mut Vec<TemplateStrPart>,
95 pending: &mut Option<(String, StringLiteralPrefix, TextRange)>,
96) {
97 if let Some((value, prefix, range)) = pending.take()
98 && !value.is_empty()
99 {
100 output.push(TemplateStrPart::Constant(Constant::new_str(
101 value, prefix, range,
102 )));
103 }
104}
105
106fn normalize_template_str_parts(values: Vec<TemplateStrPart>) -> Vec<TemplateStrPart> {
107 let mut output = Vec::with_capacity(values.len());

Callers 1

Calls 4

ConstantClass · 0.70
takeMethod · 0.45
is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected