Downcast panic payload to String too in example. · model-checking/verify-rust-std@518722e (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 518722e
Downcast panic payload to String too in example.
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -73,6 +73,8 @@ impl<'a> PanicHookInfo<'a> { | ||
73 | 73 | /// panic::set_hook(Box::new(|panic_info |
74 | 74 | /// if let Some(s) = panic_info.payload().downcast_ref::<&str>() { |
75 | 75 | /// println!("panic occurred: {s:?}"); |
76 | + /// } else if let Some(s) = panic_info.payload().downcast_ref::() { | |
77 | + /// println!("panic occurred: {s:?}"); | |
76 | 78 | /// } else { |
77 | 79 | /// println!("panic occurred"); |
78 | 80 | /// } |