Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW
✗ CI failure Fintan Halpenny committed 7 months ago
commit dcf16f9fec5cff8e7ac37bb1350426843b590ebf
parent 4d3734d317c62d3aacd21de3d29391291450c93e
2 passed 1 failed 1 pending (4 total) View logs
1 file changed +6 -7
modified crates/radicle-node/src/main.rs
@@ -310,13 +310,12 @@ fn panic_hook(info: &std::panic::PanicHookInfo) {
    let thread = std::thread::current();
    let thread = thread.name().unwrap_or("<unnamed>");

-
    let msg = match info.payload().downcast_ref::<&'static str>() {
-
        Some(s) => *s,
-
        None => match info.payload().downcast_ref::<String>() {
-
            Some(s) => &**s,
-
            None => "Box<Any>",
-
        },
-
    };
+
    let msg = info
+
        .payload()
+
        .downcast_ref::<&'static str>()
+
        .copied()
+
        .or(info.payload().downcast_ref::<String>().map(|s| s.as_str()))
+
        .unwrap_or("Box<Any>");

    match info.location() {
        Some(location) => {