We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c1e832 commit f84acf5Copy full SHA for f84acf5
src/fcntl.rs
@@ -1041,8 +1041,10 @@ pub struct Flock<T: Flockable>(T);
1041
impl<T: Flockable> Drop for Flock<T> {
1042
fn drop(&mut self) {
1043
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());
+ if let Err(e) = res {
+ if !std::thread::panicking() {
1046
+ panic!("Failed to remove flock: {}", e);
1047
+ }
1048
}
1049
1050
0 commit comments