From 6aeadebd0d6d05ede28ac4b9b5e385089273429f Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 17 Apr 2026 13:49:20 +0100 Subject: [PATCH] panic.rs: use var_os --- src/uucore/src/lib/mods/panic.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/uucore/src/lib/mods/panic.rs b/src/uucore/src/lib/mods/panic.rs index b2e2c8cfcbb..3df3c4f197a 100644 --- a/src/uucore/src/lib/mods/panic.rs +++ b/src/uucore/src/lib/mods/panic.rs @@ -52,9 +52,7 @@ pub fn preserve_inherited_sigpipe() { use nix::libc; // Check if parent specified that SIGPIPE should be default - if let Ok(val) = std::env::var("RUST_SIGPIPE") - && val == "default" - { + if std::env::var_os("RUST_SIGPIPE").is_some_and(|v| v == "default") { unsafe { libc::signal(libc::SIGPIPE, libc::SIG_DFL) }; // Remove the environment variable so child processes don't inherit it incorrectly unsafe { std::env::remove_var("RUST_SIGPIPE") };