Files @ 9e51e6ec5cf6
Branch filter:

Location: CSY/reowolf/src/test/mod.rs

9e51e6ec5cf6 685 B application/rls-services+xml Show Annotation Show as Raw Download as Raw
Hans-Dieter Hiep
Bump version
use core::fmt::Debug;

mod connector;
mod setup;

struct Panicked(Box<dyn std::any::Any>);
impl Debug for Panicked {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        if let Some(str_slice) = self.0.downcast_ref::<&'static str>() {
            f.pad(str_slice)
        } else if let Some(string) = self.0.downcast_ref::<String>() {
            f.pad(string)
        } else {
            f.pad("Box<Any>")
        }
    }
}
fn handle(result: Result<(), std::boxed::Box<(dyn std::any::Any + std::marker::Send + 'static)>>) {
    match result {
        Ok(_) => {}
        Err(x) => {
            panic!("Worker panicked: {:?}", Panicked(x));
        }
    }
}