From 99e9f6c4014488f31b6c0c6cab1bb9253d0ad072 Mon Sep 17 00:00:00 2001 From: Christopher Skane Date: Sun, 19 Nov 2023 13:57:00 -0500 Subject: [PATCH] Simplified flock error conditionals. --- test/test_fcntl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs index 174fd9cc3d..895e7709b3 100644 --- a/test/test_fcntl.rs +++ b/test/test_fcntl.rs @@ -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."); } } @@ -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."); } }