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

Commit518722e

Browse files
committed
Downcast panic payload to String too in example.
1 parentc4dea81 commit518722e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎std/src/panic.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ impl<'a> PanicHookInfo<'a> {
7373
/// panic::set_hook(Box::new(|panic_info| {
7474
/// if let Some(s) = panic_info.payload().downcast_ref::<&str>() {
7575
/// println!("panic occurred: {s:?}");
76+
/// } else if let Some(s) = panic_info.payload().downcast_ref::<String>() {
77+
/// println!("panic occurred: {s:?}");
7678
/// } else {
7779
/// println!("panic occurred");
7880
/// }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp