Skip to content

Commit

Permalink
Simplified flock error conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderBlitz committed Nov 19, 2023
1 parent 7cf6765 commit 99e9f6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ mod test_flock {
std::mem::drop(lock1);

// Attempt to lock second handle again (but successfully)
if let Err(_) = Flock::lock(file2, FlockArg::LockExclusiveNonblock) {
if Flock::lock(file2, FlockArg::LockExclusiveNonblock).is_err() {
panic!("Expected locking to be successful.");
}
}
Expand All @@ -652,7 +652,7 @@ mod test_flock {
let _file1 = lock1.unlock();

// Attempt to lock second handle.
if let Err(_) = Flock::lock(file2, FlockArg::LockExclusiveNonblock) {
if Flock::lock(file2, FlockArg::LockExclusiveNonblock).is_err() {
panic!("Expected locking to be successful.");
}
}
Expand Down

0 comments on commit 99e9f6c

Please sign in to comment.