// removes frames before wrangler takes over at the panic, reduces noise
removes frames before wrangler takes over at the panic, reduces noise
removes frames before wrangler takes over at the panic reduces noise
fn useful_frames() -> String {
    let bt = Backtrace::new();
    let frames = bt.frames();
    let found_idx = frames.iter().position(|frame| {
        for sym in frame.symbols() {
            if let Some(name) = sym.name() {
                return name.to_string() == PANIC_UNWIND_START_MARKER;
            }
        }
        false
    });
    let skip_count = match found_idx {
        Some(idx) => idx + 1,
        None => 0,
    };
    let useful = frames
        .iter()
        .skip(skip_count)
        .filter(|frame| {
            for sym in frame.symbols() {
                if let Some(name) = sym.name() {
                    return !name.to_string().starts_with(BACKTRACE_PATH_PREFIX);
                }
            }
            true
        })
        .cloned()
        .collect::<Vec<BacktraceFrame>>();
    format!("{:?}", Backtrace::from(useful)).trim().to_string()
}
fn useful_frames ( ) -> String { let bt = Backtrace :: new ( ) ; let frames = bt . frames ( ) ; let found_idx = frames . iter ( ) . position ( | frame | { for sym in frame . symbols ( ) { if let Some ( name ) = sym . name ( ) { return name . to_string ( ) == PANIC_UNWIND_START_MARKER ; } } false } ) ; let skip_count = match found_idx { Some ( idx ) => idx + 1 , None => 0 , } ; let useful = frames . iter ( ) . skip ( skip_count ) . filter ( | frame | { for sym in frame . symbols ( ) { if let Some ( name ) = sym . name ( ) { return ! name . to_string ( ) . starts_with ( BACKTRACE_PATH_PREFIX ) ; } } true } ) . cloned ( ) . collect :: < Vec < BacktraceFrame > > ( ) ; format ! ( " " Backtrace from ( useful ) ) . trim ( ) . to_string ( ) }
removes frames before wrangler takes over at the panic, reduces noise
removes frames before wrangler takes over at the panic reduces noise