Skip to content

Commit 72a2875

Browse files
committed
Use Display representation of err: &str
1 parent 8e6e649 commit 72a2875

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libwasmvm/src/handle_vm_panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ use std::any::Any;
55
/// We want to provide as much debug information as possible
66
/// as those cases are not expected to happen during healthy operations.
77
pub fn handle_vm_panic(what: &str, err: Box<dyn Any + Send + 'static>) {
8-
let err = match (err.downcast_ref::<&str>(), err.downcast_ref::<String>()) {
8+
let err: &str = match (err.downcast_ref::<&str>(), err.downcast_ref::<String>()) {
99
(Some(str), ..) => *str,
1010
(.., Some(str)) => str,
1111
(None, None) => "[unusable panic payload]",
1212
};
1313

1414
eprintln!("Panic in {what}:");
15-
eprintln!("{err:?}");
15+
eprintln!("{err}");
1616
eprintln!(
1717
"This indicates a panic in during the operations of libwasmvm/cosmwasm-vm.
1818
Such panics must not happen and are considered bugs. If you see this in any real-world or

0 commit comments

Comments
 (0)