diff options
author | Michael Baikov <manpacket@gmail.com> | 2022-08-04 07:54:45 +0800 |
---|---|---|
committer | Michael Baikov <manpacket@gmail.com> | 2022-08-04 09:44:40 +0800 |
commit | a6ee63ac3212e62518c97252581cfa48e2ad056e (patch) | |
tree | a57022d55d6c819491a1ac9c510049748034440e /test/sys/test_aio.rs | |
parent | 854a5469c0475acf2e57b63740c9e447d3b9e4f8 (diff) | |
download | nix-a6ee63ac3212e62518c97252581cfa48e2ad056e.zip |
fix clippy assertions_on_result_states
https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states
Diffstat (limited to 'test/sys/test_aio.rs')
-rw-r--r-- | test/sys/test_aio.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/sys/test_aio.rs b/test/sys/test_aio.rs index b4ea6757..12749b1d 100644 --- a/test/sys/test_aio.rs +++ b/test/sys/test_aio.rs @@ -85,7 +85,7 @@ mod aio_fsync { SigevNotify::SigevNone, )); let err = aiof.as_mut().submit(); - assert!(err.is_err()); + err.expect_err("assertion failed"); } #[test] @@ -102,7 +102,7 @@ mod aio_fsync { SigevNotify::SigevNone, )); let err = aiof.as_mut().submit(); - assert!(err.is_ok()); + err.expect("assert failed"); poll_aio!(&mut aiof).unwrap(); aiof.as_mut().aio_return().unwrap(); } @@ -149,7 +149,7 @@ mod aio_read { aior.as_mut().submit().unwrap(); let cancelstat = aior.as_mut().cancel(); - assert!(cancelstat.is_ok()); + cancelstat.expect("assert failed"); // Wait for aiow to complete, but don't care whether it succeeded let _ = poll_aio!(&mut aior); @@ -174,7 +174,7 @@ mod aio_read { 0, //priority SigevNotify::SigevNone, )); - assert!(aior.as_mut().submit().is_err()); + aior.as_mut().submit().expect_err("assertion failed"); } // Test a simple aio operation with no completion notification. We must @@ -342,7 +342,7 @@ mod aio_write { assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); let cancelstat = aiow.as_mut().cancel(); - assert!(cancelstat.is_ok()); + cancelstat.expect("assert failed"); // Wait for aiow to complete, but don't care whether it succeeded let _ = poll_aio!(&mut aiow); @@ -426,7 +426,7 @@ mod aio_write { 0, //priority SigevNotify::SigevNone, )); - assert!(aiow.as_mut().submit().is_err()); + aiow.as_mut().submit().expect_err("assertion failed"); // Dropping the AioWrite at this point should not panic } } @@ -565,7 +565,7 @@ fn test_aio_cancel_all() { assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); let cancelstat = aio_cancel_all(f.as_raw_fd()); - assert!(cancelstat.is_ok()); + cancelstat.expect("assert failed"); // Wait for aiocb to complete, but don't care whether it succeeded let _ = poll_aio!(&mut aiocb); |