Skip to content

Commit

Permalink
chore: use PanicHookInfo over PanicHook
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Oct 2, 2024
1 parent 6a97c15 commit b056ecf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ pub enum TestFailure<'a, E> {
Error(E),

/// This is used to indicate that the test failed due to a panic. The
/// [`PanicInfo`](std::panic::PanicInfo) contains information about the
/// panic and can be obtained by calling
/// [`PanicHookInfo`](std::panic::PanicHookInfo) contains information about
/// the panic and can be obtained by calling
/// [`set_hook`](std::panic::set_hook).
Panic(&'a std::panic::PanicInfo<'a>),
Panic(&'a std::panic::PanicHookInfo<'a>),
}

fn exit(result: Result<(), Failure>) {
Expand Down Expand Up @@ -339,8 +339,8 @@ impl FromStr for PanicInfo {
}
}

impl From<&panic::PanicInfo<'_>> for PanicInfo {
fn from(info: &panic::PanicInfo) -> Self {
impl From<&panic::PanicHookInfo<'_>> for PanicInfo {
fn from(info: &panic::PanicHookInfo) -> Self {
let payload = info.payload();

let msg = downcast_display::<&str>(payload)
Expand Down

0 comments on commit b056ecf

Please sign in to comment.