Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit249d63e

Browse files
committed
Use payload_as_str instead of two downcasts.
1 parent15677e9 commit249d63e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎std/src/panic.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ impl fmt::Display for PanicHookInfo<'_> {
202202
fnfmt(&self,formatter:&mut fmt::Formatter<'_>) -> fmt::Result{
203203
formatter.write_str("panicked at ")?;
204204
self.location.fmt(formatter)?;
205-
ifletSome(payload) =self.payload.downcast_ref::<&'staticstr>(){
206-
formatter.write_str(":\n")?;
207-
formatter.write_str(payload)?;
208-
}elseifletSome(payload) =self.payload.downcast_ref::<String>(){
205+
ifletSome(payload) =self.payload_as_str(){
209206
formatter.write_str(":\n")?;
210207
formatter.write_str(payload)?;
211208
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp