remove unnecessary Box

This commit is contained in:
soruh 2023-03-18 15:25:32 +01:00
parent 022f01e532
commit 931b976a34

View File

@ -162,7 +162,8 @@ async fn main() -> anyhow::Result<()> {
Err(err) => {
let err = err
.downcast::<String>()
.unwrap_or_else(|_| Box::new("?".to_owned()));
.map(|err| *err)
.unwrap_or_else(|_| "?".to_owned());
Some(format!("panic at: {err}"))
}