1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 21:17:46 +00:00

uucore: replace PanicInfo with PanicHookInfo

This commit is contained in:
Daniel Hofstetter 2025-03-04 11:03:18 +01:00
parent 72299d3e16
commit ac30e4cf92

View file

@ -13,15 +13,10 @@
//! $ seq inf | head -n 1
//! ```
//!
use std::panic;
// TODO: use PanicHookInfo when we have a MSRV of 1.81
#[allow(deprecated)]
use std::panic::PanicInfo;
use std::panic::{self, PanicHookInfo};
/// 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 {
fn is_broken_pipe(info: &PanicHookInfo) -> bool {
if let Some(res) = info.payload().downcast_ref::<String>() {
if res.contains("BrokenPipe") || res.contains("Broken pipe") {
return true;