// DTrace doesn't properly demangle Rust function names, so fix those.
DTrace doesn't properly demangle Rust function names, so fix those.
DTrace doesn ' t properly demangle Rust function names so fix those .
fn fix_rust_symbol<'a>(&self, frame: &'a str) -> Cow<'a, str> {
        let mut parts = frame.splitn(2, '`');
        if let (Some(pname), Some(func)) = (parts.next(), parts.next()) {
            if self.opt.includeoffset {
                let mut parts = func.rsplitn(2, '+');
                if let (Some(offset), Some(func)) = (parts.next(), parts.next()) {
                    if let Cow::Owned(func) =
                        common::fix_partially_demangled_rust_symbol(func.trim_end())
                    {
                        return Cow::Owned(format!("{}`{}+{}", pname, func, offset));
                    } else {
                        return Cow::Borrowed(frame);
                    }
                }
            }
            if let Cow::Owned(func) = common::fix_partially_demangled_rust_symbol(func.trim_end()) {
                return Cow::Owned(format!("{}`{}", pname, func));
            }
        }
        Cow::Borrowed(frame)
    }
fn fix_rust_symbol < ' a > ( & self , frame : & ' a str ) -> Cow < ' a , str > { let mut parts = frame . splitn ( 2 , '`' ) ; if let ( Some ( pname ) , Some ( func ) ) = ( parts . next ( ) , parts . next ( ) ) { if self . opt . includeoffset { let mut parts = func . rsplitn ( 2 , '+' ) ; if let ( Some ( offset ) , Some ( func ) ) = ( parts . next ( ) , parts . next ( ) ) { if let Cow :: Owned ( func ) = common :: fix_partially_demangled_rust_symbol ( func . trim_end ( ) ) { return Cow :: Owned ( format ! ( " " pname func offset ) ) ; } else { return Cow :: Borrowed ( frame ) ; } } } if let Cow :: Owned ( func ) = common :: fix_partially_demangled_rust_symbol ( func . trim_end ( ) ) { return Cow :: Owned ( format ! ( " " pname func ) ) ; } } Cow :: Borrowed ( frame ) }
DTrace doesn't properly demangle Rust function names, so fix those.
DTrace doesn ' t properly demangle Rust function names so fix those .
&self
frame
&'a str