fn demangle( which: &str ) -> String
{
	let empty  = String::with_capacity(0);
	let bt     = Backtrace::new();
	let frames = bt.frames();

	let frame = &frames.get( 4 );

	if let Some( frame  ) = frame {
	if let Some( symbol ) = frame.symbols().last()
	{
		format!
		(
			  "PANIC - fn `{}` calls `{}` @ {}:{}"
			, symbol.name()    .map( |s| strip( format!( "{}", s ) )     ).unwrap_or_else( || empty.clone() )
			, which
			, symbol.filename().map( |s| s.to_string_lossy().to_string() ).unwrap_or_else( || empty.clone() )
			, symbol.lineno()  .map( |s| format!( "{}", s )              ).unwrap_or( empty )
		)

	} else { empty }
	} else { empty }
}
// Demangle the API of the backtrace crate!
//
// Returns the caller function name + file:lineno for logging in ResultExtSlog
//
Demangle the API of the backtrace crate.
Returns the caller function name + file:lineno for logging in ResultExtSlog
Demangle the API of the backtrace crate . Returns the caller function name + file : lineno for logging in ResultExtSlog
fn demangle( which: &str ) -> String
{
	let empty  = String::with_capacity(0);
	let bt     = Backtrace::new();
	let frames = bt.frames();
	let frame = &frames.get( 4 );
	if let Some( frame  ) = frame {
	if let Some( symbol ) = frame.symbols().last()
	{
		format!
		(
			  "PANIC - fn `{}` calls `{}` @ {}:{}"
			, symbol.name()    .map( |s| strip( format!( "{}", s ) )     ).unwrap_or_else( || empty.clone() )
			, which
			, symbol.filename().map( |s| s.to_string_lossy().to_string() ).unwrap_or_else( || empty.clone() )
			, symbol.lineno()  .map( |s| format!( "{}", s )              ).unwrap_or( empty )
		)
	} else { empty }
	} else { empty }
}
fn demangle ( which : & str ) -> String { let empty = String :: with_capacity ( 0 ) ; let bt = Backtrace :: new ( ) ; let frames = bt . frames ( ) ; let frame = & frames . get ( 4 ) ; if let Some ( frame ) = frame { if let Some ( symbol ) = frame . symbols ( ) . last ( ) { format ! ( " " symbol name ( ) map ( s strip ( format ( " " s ) ) ) unwrap_or_else ( empty clone ( ) ) which symbol filename ( ) map ( s s to_string_lossy ( ) to_string ( ) ) unwrap_or_else ( empty clone ( ) ) symbol lineno ( ) map ( s format ( " " s ) ) unwrap_or ( empty ) ) } else { empty } } else { empty } }
Demangle the API of the backtrace crate!
Demangle the API of the backtrace crate!
which
&str
which
&str