1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #6792 from cakebaker/uucore_allow_deprecated

uucore: allow use of deprecated `PanicInfo`
This commit is contained in:
Sylvestre Ledru 2024-10-18 08:29:15 +02:00 committed by GitHub
commit 93c3d004d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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