Skip to content

Commit 8e0bd51

Browse files
committed
fix panic hook
1 parent 1f67bf2 commit 8e0bd51

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,13 @@ fn panic_hook(info: &PanicHookInfo<'_>) {
213213
fn panic_hook(info: &PanicHookInfo<'_>) {
214214
use human_panic::{handle_dump, print_msg, Metadata};
215215

216-
let meta = Metadata {
217-
version: env!("CARGO_PKG_VERSION").into(),
218-
name: env!("CARGO_PKG_NAME").into(),
219-
authors: env!("CARGO_PKG_AUTHORS").replace(":", ", ").into(),
220-
homepage: env!("CARGO_PKG_HOMEPAGE").into(),
221-
};
216+
let meta = Metadata::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))
217+
.authors(env!("CARGO_PKG_AUTHORS").replace(':', ", "))
218+
.homepage(env!("CARGO_PKG_HOMEPAGE"));
219+
222220
let file_path = handle_dump(&meta, info);
223221
disable_raw_mode().unwrap();
224222
execute!(io::stdout(), LeaveAlternateScreen, DisableMouseCapture).unwrap();
225223
print_msg(file_path, &meta).expect("human-panic: printing error message to console failed");
226224
}
225+

0 commit comments

Comments
 (0)