Skip to content

Commit 57f83bf

Browse files
committed
Fix deprecation
1 parent cad2d5d commit 57f83bf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sentry-panic/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! # Configuration
99
//!
1010
//! The panic integration can be configured with an additional extractor, which
11-
//! might optionally create a sentry `Event` out of a `PanicInfo`.
11+
//! might optionally create a sentry `Event` out of a `PanicHookInfo`.
1212
//!
1313
//! ```
1414
//! let integration = sentry_panic::PanicIntegration::default().add_extractor(|info| None);
@@ -19,7 +19,7 @@
1919
#![warn(missing_docs)]
2020
#![deny(unsafe_code)]
2121

22-
use std::panic::{self, PanicInfo};
22+
use std::panic::{self, PanicHookInfo};
2323
use std::sync::Once;
2424

2525
use sentry_backtrace::current_stacktrace;
@@ -31,7 +31,7 @@ use sentry_core::{ClientOptions, Integration};
3131
/// This panic handler reports panics to Sentry. It also attempts to prevent
3232
/// double faults in some cases where it's known to be unsafe to invoke the
3333
/// Sentry panic handler.
34-
pub fn panic_handler(info: &PanicInfo<'_>) {
34+
pub fn panic_handler(info: &PanicHookInfo<'_>) {
3535
sentry_core::with_integration(|integration: &PanicIntegration, hub| {
3636
hub.capture_event(integration.event_from_panic_info(info));
3737
if let Some(client) = hub.client() {
@@ -40,7 +40,7 @@ pub fn panic_handler(info: &PanicInfo<'_>) {
4040
});
4141
}
4242

43-
type PanicExtractor = dyn Fn(&PanicInfo<'_>) -> Option<Event<'static>> + Send + Sync;
43+
type PanicExtractor = dyn Fn(&PanicHookInfo<'_>) -> Option<Event<'static>> + Send + Sync;
4444

4545
/// The Sentry Panic handler Integration.
4646
#[derive(Default)]
@@ -75,7 +75,7 @@ impl Integration for PanicIntegration {
7575
}
7676

7777
/// Extract the message of a panic.
78-
pub fn message_from_panic_info<'a>(info: &'a PanicInfo<'_>) -> &'a str {
78+
pub fn message_from_panic_info<'a>(info: &'a PanicHookInfo<'_>) -> &'a str {
7979
match info.payload().downcast_ref::<&'static str>() {
8080
Some(s) => s,
8181
None => match info.payload().downcast_ref::<String>() {
@@ -95,7 +95,7 @@ impl PanicIntegration {
9595
#[must_use]
9696
pub fn add_extractor<F>(mut self, f: F) -> Self
9797
where
98-
F: Fn(&PanicInfo<'_>) -> Option<Event<'static>> + Send + Sync + 'static,
98+
F: Fn(&PanicHookInfo<'_>) -> Option<Event<'static>> + Send + Sync + 'static,
9999
{
100100
self.extractors.push(Box::new(f));
101101
self
@@ -104,7 +104,7 @@ impl PanicIntegration {
104104
/// Creates an event from the given panic info.
105105
///
106106
/// The stacktrace is calculated from the current frame.
107-
pub fn event_from_panic_info(&self, info: &PanicInfo<'_>) -> Event<'static> {
107+
pub fn event_from_panic_info(&self, info: &PanicHookInfo<'_>) -> Event<'static> {
108108
for extractor in &self.extractors {
109109
if let Some(event) = extractor(info) {
110110
return event;

0 commit comments

Comments
 (0)