pub fn demangle_text(text: &String) -> String {
    use self::regex::Regex;

    lazy_static!{
        static ref IDENT_NAME: Regex = if cfg!(target_os = "macos") {
            Regex::new(r"___mu_\w+").unwrap()
        } else {
            Regex::new(r"__mu_\w+").unwrap()
        };
    }

    let mut res = text.clone();
    for cap in IDENT_NAME.captures_iter(&text) {
        let name = cap.get(0).unwrap().as_str().to_string();
        let demangled = demangle_name(name.clone());
        res = res.replacen(&name, &demangled, 1);
    }

    res
}
/// identifies mu names and demangles them
identifies mu names and demangles them
identifies mu names and demangles them
pub fn demangle_text(text: &String) -> String {
    use self::regex::Regex;
    lazy_static!{
        static ref IDENT_NAME: Regex = if cfg!(target_os = "macos") {
            Regex::new(r"___mu_\w+").unwrap()
        } else {
            Regex::new(r"__mu_\w+").unwrap()
        };
    }
    let mut res = text.clone();
    for cap in IDENT_NAME.captures_iter(&text) {
        let name = cap.get(0).unwrap().as_str().to_string();
        let demangled = demangle_name(name.clone());
        res = res.replacen(&name, &demangled, 1);
    }
    res
}
pub fn demangle_text ( text : & String ) -> String { use self :: regex :: Regex ; lazy_static ! { static ref IDENT_NAME Regex if cfg ( target_os " " ) { Regex new ( r"___mu_\w+" ) unwrap ( ) } else { Regex new ( r"__mu_\w+" ) unwrap ( ) } } let mut res = text . clone ( ) ; for cap in IDENT_NAME . captures_iter ( & text ) { let name = cap . get ( 0 ) . unwrap ( ) . as_str ( ) . to_string ( ) ; let demangled = demangle_name ( name . clone ( ) ) ; res = res . replacen ( & name , & demangled , 1 ) ; } res }
identifies mu names and demangles them
identifies mu names and demangles them
text
&String
text
&String