From 47e1f5d2589c9b0552779146f6b2a723342d248b Mon Sep 17 00:00:00 2001 From: Christopher Skane Date: Wed, 22 Nov 2023 19:16:09 -0500 Subject: [PATCH] More linting fixes. --- src/fcntl.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index e2d80e24a3..3ed75d20b5 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -647,10 +647,8 @@ pub struct Flock(T); #[cfg(not(any(target_os = "redox", target_os = "solaris")))] impl Drop for Flock { fn drop(&mut self) { - if Errno::result(unsafe { libc::flock(self.0.as_raw_fd(), libc::LOCK_UN) }).is_err() { - if !std::thread::panicking() { - panic!("Failed to remove flock."); - } + if Errno::result(unsafe { libc::flock(self.0.as_raw_fd(), libc::LOCK_UN) }).is_err() && !std::thread::panicking() { + panic!("Failed to remove flock."); } } }