Converts a dynamic panic-related error into a string.
(err: Box<dyn Any + Send + 'static>)
| 30 | |
| 31 | /// Converts a dynamic panic-related error into a string. |
| 32 | fn stringify_panic_error(err: Box<dyn Any + Send + 'static>) -> String { |
| 33 | if let Some(&msg) = err.downcast_ref::<&str>() { |
| 34 | msg.to_string() |
| 35 | } else if let Ok(msg) = err.downcast::<String>() { |
| 36 | *msg |
| 37 | } else { |
| 38 | "unknown".to_string() |
| 39 | } |
| 40 | } |
no outgoing calls
no test coverage detected