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

Function push_joined_str_literal

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

Source from the content-addressed store, hash-verified

48}
49
50fn push_joined_str_literal(
51 output: &mut Vec<JoinedStrPart>,
52 pending: &mut Option<(String, StringLiteralPrefix, TextRange)>,
53) {
54 if let Some((value, prefix, range)) = pending.take()
55 && !value.is_empty()
56 {
57 output.push(JoinedStrPart::Constant(Constant::new_str(
58 value, prefix, range,
59 )));
60 }
61}
62
63fn normalize_joined_str_parts(values: Vec<JoinedStrPart>) -> Vec<JoinedStrPart> {
64 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