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:
commit
37a94b4bec
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