Skip to content

Commit acbf0d8

Browse files
authored
Change &(dyn Any + Send) to just &dyn Any. (#18)
The `Send` trait is a useless restriction for references.
1 parent f1f2d65 commit acbf0d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::panic;
1616

1717
use serde_::{Deserialize, Serialize};
1818

19-
fn serialize_panic(panic: &(dyn Any + Send + 'static)) -> PanicInfo {
19+
fn serialize_panic(panic: &dyn Any) -> PanicInfo {
2020
PanicInfo::new(match panic.downcast_ref::<&'static str>() {
2121
Some(s) => *s,
2222
None => match panic.downcast_ref::<String>() {
@@ -169,7 +169,7 @@ fn reset_panic_info() {
169169
});
170170
}
171171

172-
fn take_panic_info(payload: &(dyn Any + Send + 'static)) -> PanicInfo {
172+
fn take_panic_info(payload: &dyn Any) -> PanicInfo {
173173
PANIC_INFO
174174
.with(|pi| pi.borrow_mut().take())
175175
.unwrap_or_else(move || serialize_panic(payload))

0 commit comments

Comments
 (0)