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

Function template_parts_to_elements

crates/vm/src/stdlib/_ast/string.rs:739–748  ·  view source on GitHub ↗
(
    vm: &VirtualMachine,
    values: Box<[TemplateStrPart]>,
)

Source from the content-addressed store, hash-verified

737}
738
739fn template_parts_to_elements(
740 vm: &VirtualMachine,
741 values: Box<[TemplateStrPart]>,
742) -> PyResult<ast::InterpolatedStringElements> {
743 let mut elements = Vec::with_capacity(values.len());
744 for value in values.into_vec() {
745 elements.push(template_part_to_element(vm, value)?);
746 }
747 Ok(ast::InterpolatedStringElements::from(elements))
748}
749
750fn template_part_to_element(
751 vm: &VirtualMachine,

Callers 2

template_str_to_exprFunction · 0.85
interpolation_to_exprFunction · 0.85

Calls 4

template_part_to_elementFunction · 0.85
lenMethod · 0.45
into_vecMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected