1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

uucore: allow use of deprecated PanicInfo

This commit is contained in:
Daniel Hofstetter 2024-10-18 07:31:42 +02:00
parent e3b8191926
commit 91687ebbc1

View file

@ -14,9 +14,13 @@
//! ```
//!
use std::panic;
// TODO: use PanicHookInfo when we have a MSRV of 1.81
#[allow(deprecated)]
use std::panic::PanicInfo;
/// Decide whether a panic was caused by a broken pipe (SIGPIPE) error.
// TODO: use PanicHookInfo when we have a MSRV of 1.81
#[allow(deprecated)]
fn is_broken_pipe(info: &PanicInfo) -> bool {
if let Some(res) = info.payload().downcast_ref::<String>() {
if res.contains("BrokenPipe") || res.contains("Broken pipe") {