mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 13:37:48 +00:00
uucore: replace PanicInfo with PanicHookInfo
This commit is contained in:
parent
72299d3e16
commit
ac30e4cf92
1 changed files with 2 additions and 7 deletions
|
@ -13,15 +13,10 @@
|
||||||
//! $ seq inf | head -n 1
|
//! $ seq inf | head -n 1
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
use std::panic;
|
use std::panic::{self, PanicHookInfo};
|
||||||
// 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.
|
/// Decide whether a panic was caused by a broken pipe (SIGPIPE) error.
|
||||||
// TODO: use PanicHookInfo when we have a MSRV of 1.81
|
fn is_broken_pipe(info: &PanicHookInfo) -> bool {
|
||||||
#[allow(deprecated)]
|
|
||||||
fn is_broken_pipe(info: &PanicInfo) -> bool {
|
|
||||||
if let Some(res) = info.payload().downcast_ref::<String>() {
|
if let Some(res) = info.payload().downcast_ref::<String>() {
|
||||||
if res.contains("BrokenPipe") || res.contains("Broken pipe") {
|
if res.contains("BrokenPipe") || res.contains("Broken pipe") {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue