Skip to content

Commit 26223ad

Browse files
xtqqczzecakebaker
authored andcommitted
panic.rs: use var_os
1 parent 50ca60a commit 26223ad

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/uucore/src/lib/mods/panic.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ pub fn preserve_inherited_sigpipe() {
5252
use nix::libc;
5353

5454
// Check if parent specified that SIGPIPE should be default
55-
if let Ok(val) = std::env::var("RUST_SIGPIPE")
56-
&& val == "default"
57-
{
55+
if std::env::var_os("RUST_SIGPIPE").is_some_and(|v| v == "default") {
5856
unsafe { libc::signal(libc::SIGPIPE, libc::SIG_DFL) };
5957
// Remove the environment variable so child processes don't inherit it incorrectly
6058
unsafe { std::env::remove_var("RUST_SIGPIPE") };

0 commit comments

Comments
 (0)