pub fn mangle_name(name: MuName) -> String {
    let name = name.replace('@', "");
    if name.starts_with("__mu_") {
        // TODO: Get rid of this, since it will be triggered if a client provides a name
        // starting with "__mu" which is totally valid, it's only here for the moment to
        // debug name handling
        panic!("Trying to mangle \"{}\", which is already mangled", name.clone());
    }

    assert!(!name.starts_with("%"));

    // Note: a ':'  and '#' is only used by names generated by zebu itself
    let name = name.replace('Z', "ZZ")
        .replace('.', "Zd")
        .replace('-', "Zh")
        .replace(':', "Zc")
        .replace('#', "Za");
    "__mu_".to_string() + name.as_str()
}
/// changes name to mangled name
/// This will always return a valid C identifier
changes name to mangled name
This will always return a valid C identifier
changes name to mangled name This will always return a valid C identifier
pub fn mangle_name(name: MuName) -> String {
    let name = name.replace('@', "");
    if name.starts_with("__mu_") {
        // TODO: Get rid of this, since it will be triggered if a client provides a name
        // starting with "__mu" which is totally valid, it's only here for the moment to
        // debug name handling
        panic!("Trying to mangle \"{}\", which is already mangled", name.clone());
    }
    assert!(!name.starts_with("%"));
    // Note: a ':'  and '#' is only used by names generated by zebu itself
    let name = name.replace('Z', "ZZ")
        .replace('.', "Zd")
        .replace('-', "Zh")
        .replace(':', "Zc")
        .replace('#', "Za");
    "__mu_".to_string() + name.as_str()
}
pub fn mangle_name ( name : MuName ) -> String { let name = name . replace ( '@' , " " ) ; if name . starts_with ( " " ) { // TODO: Get rid of this, since it will be triggered if a client provides a name // starting with "__mu" which is totally valid, it's only here for the moment to // debug name handling panic ! ( " \" \" " name clone ( ) ) ; } assert ! ( name starts_with ( " " ) ) ; // Note: a ':'  and '#' is only used by names generated by zebu itself let name = name . replace ( 'Z' , " " ) . replace ( '.' , " " ) . replace ( '-' , " " ) . replace ( ':' , " " ) . replace ( '#' , " " ) ; " " . to_string ( ) + name . as_str ( ) }
changes name to mangled name
This will always return a valid C identifier
changes name to mangled name This will always return a valid C identifier
name
MuName
name
MuName