Skip to content

Commit

Permalink
Change &(dyn Any + Send) to &dyn Any. (#45)
Browse files Browse the repository at this point in the history
The `Send` trait is useless for references.
  • Loading branch information
m-ou-se authored May 26, 2023
1 parent c48e9b1 commit e269f95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn reset_panic_info() {
});
}

pub fn take_panic(panic: &(dyn Any + Send + 'static)) -> PanicInfo {
pub fn take_panic(panic: &dyn Any) -> PanicInfo {
PANIC_INFO
.with(|pi| pi.borrow_mut().take())
.unwrap_or_else(move || serialize_panic(panic))
Expand Down Expand Up @@ -57,7 +57,7 @@ pub fn init_panic_hook(capture_backtraces: BacktraceCapture) {
}));
}

fn serialize_panic(panic: &(dyn Any + Send + 'static)) -> PanicInfo {
fn serialize_panic(panic: &dyn Any) -> PanicInfo {
PanicInfo::new(match panic.downcast_ref::<&'static str>() {
Some(s) => s,
None => match panic.downcast_ref::<String>() {
Expand Down

0 comments on commit e269f95

Please sign in to comment.