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
|
||||
//! ```
|
||||
//!
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue