fn rust_mangle(rust_name: &str) -> String {
    let mangled = &rust_name
        .split("::")
        .into_iter()
        .map(|x| format!("{}{}", x.len(), x))
        .collect::<Vec<String>>()
        .concat();
    "_ZN".to_string() + mangled
}
/// Apply Rust mangling rule to a function name like 'foo::bar'.
/// Does not insert a unique hash at the end or the final 'E' character.
Apply Rust mangling rule to a function name like 'foo::bar'.
Does not insert a unique hash at the end or the final 'E' character.
Apply Rust mangling rule to a function name like ' foo :: bar ' . Does not insert a unique hash at the end or the final ' E ' character .
fn rust_mangle(rust_name: &str) -> String {
    let mangled = &rust_name
        .split("::")
        .into_iter()
        .map(|x| format!("{}{}", x.len(), x))
        .collect::<Vec<String>>()
        .concat();
    "_ZN".to_string() + mangled
}
fn rust_mangle ( rust_name : & str ) -> String { let mangled = & rust_name . split ( " " ) . into_iter ( ) . map ( | x | format ! ( " " x len ( ) x ) ) . collect :: < Vec < String > > ( ) . concat ( ) ; " " . to_string ( ) + mangled }
Apply Rust mangling rule to a function name like 'foo::bar'.
Apply Rust mangling rule to a function name like ' foo :: bar ' .
rust_name
&str
rust_name
&str