Skip to content

Commit f84acf5

Browse files
committed
clippy: unnecessary_unwrap
1 parent 9c1e832 commit f84acf5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fcntl.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,10 @@ pub struct Flock<T: Flockable>(T);
10411041
impl<T: Flockable> Drop for Flock<T> {
10421042
fn drop(&mut self) {
10431043
let res = Errno::result(unsafe { libc::flock(self.0.as_raw_fd(), libc::LOCK_UN) });
1044-
if res.is_err() && !std::thread::panicking() {
1045-
panic!("Failed to remove flock: {}", res.unwrap_err());
1044+
if let Err(e) = res {
1045+
if !std::thread::panicking() {
1046+
panic!("Failed to remove flock: {}", e);
1047+
}
10461048
}
10471049
}
10481050
}

0 commit comments

Comments
 (0)