@@ -202,10 +202,7 @@ impl fmt::Display for PanicHookInfo<'_> { |
|
|
202 |
202 |
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { |
203 |
203 |
formatter.write_str("panicked at ")?; |
204 |
204 |
self.location.fmt(formatter)?; |
205 |
|
-if let Some(payload) = self.payload.downcast_ref::<&'static str>() { |
206 |
|
- formatter.write_str(":\n")?; |
207 |
|
- formatter.write_str(payload)?; |
208 |
|
-} else if let Some(payload) = self.payload.downcast_ref::<String>() { |
|
205 |
+if let Some(payload) = self.payload_as_str() { |
209 |
206 |
formatter.write_str(":\n")?; |
210 |
207 |
formatter.write_str(payload)?; |
211 |
208 |
} |