From 4433e6dda5466955a21f168476b0483db05839bf Mon Sep 17 00:00:00 2001 From: Deepu Date: Wed, 28 Aug 2024 18:03:30 +0200 Subject: [PATCH] fix human panic error --- src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index e65e6be..1692a30 100644 --- a/src/main.rs +++ b/src/main.rs @@ -304,12 +304,10 @@ fn panic_hook(info: &PanicInfo<'_>) { use human_panic::{handle_dump, print_msg, Metadata}; use log::error; - let meta = Metadata { - version: env!("CARGO_PKG_VERSION").into(), - name: env!("CARGO_PKG_NAME").into(), - authors: env!("CARGO_PKG_AUTHORS").replace(':', ", ").into(), - homepage: env!("CARGO_PKG_HOMEPAGE").into(), - }; + let meta = Metadata::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")) + .authors(env!("CARGO_PKG_AUTHORS").replace(':', ", ")) + .homepage(env!("CARGO_PKG_HOMEPAGE")); + let file_path = handle_dump(&meta, info); let (msg, location) = get_panic_info(info); let stacktrace: String = format!("{:?}", Backtrace::new()).replace('\n', "\n\r");