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

Function maybe_mangle_name

crates/codegen/src/symboltable.rs:2815–2826  ·  view source on GitHub ↗

Selective mangling for type parameter scopes around generic classes. If `mangled_names` is Some, only mangle names that are in the set; other names are left unmangled.

(
    class_name: Option<&str>,
    mangled_names: Option<&IndexSet<String>>,
    name: &'a str,
)

Source from the content-addressed store, hash-verified

2813/// If `mangled_names` is Some, only mangle names that are in the set;
2814/// other names are left unmangled.
2815pub(crate) fn maybe_mangle_name<'a>(
2816 class_name: Option<&str>,
2817 mangled_names: Option<&IndexSet<String>>,
2818 name: &'a str,
2819) -> Cow<'a, str> {
2820 if let Some(set) = mangled_names
2821 && !set.contains(name)
2822 {
2823 return name.into();
2824 }
2825 mangle_name(class_name, name)
2826}

Callers 2

register_nameMethod · 0.85
mangleMethod · 0.85

Calls 2

mangle_nameFunction · 0.70
containsMethod · 0.45

Tested by

no test coverage detected