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

Merge pull request #7395 from cakebaker/uucore_use_panic_hook_info

uucore: replace `PanicInfo` with `PanicHookInfo`
This commit is contained in:
Sylvestre Ledru 2025-03-04 14:22:49 +01:00 committed by GitHub
commit 37a94b4bec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;