summaryrefslogtreecommitdiff
path: root/src/sys/aio.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-05-30 12:27:39 -0600
committerAlan Somers <asomers@gmail.com>2021-05-30 20:12:41 -0600
commit7b7d9540056f6378820caf955a0335268184d6b7 (patch)
treef27fa7b8dbb4d089c0f7bda9569bfab8ead1b4dc /src/sys/aio.rs
parenta55dd4537286c8fbd96e3e21e18c56a38f8124b9 (diff)
downloadnix-7b7d9540056f6378820caf955a0335268184d6b7.zip
misc Clippy cleanup
* Fix race conditions in the tests. Two tests were grabbing a mutex but immediately dropping it. Thank you, Clippy. * Remove vestigial Windows support. Remove some code added to support Windows in 2015. Nix is no longer intended to ever run on Windows. * Various other minor Clippy lints.
Diffstat (limited to 'src/sys/aio.rs')
-rw-r--r--src/sys/aio.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sys/aio.rs b/src/sys/aio.rs
index 7868a294..a03caa45 100644
--- a/src/sys/aio.rs
+++ b/src/sys/aio.rs
@@ -513,7 +513,7 @@ impl<'a> AioCb<'a> {
}
}
- fn error_unpinned(self: &mut Self) -> Result<()> {
+ fn error_unpinned(&mut self) -> Result<()> {
let r = unsafe {
libc::aio_error(&mut self.aiocb.0 as *mut libc::aiocb)
};
@@ -645,7 +645,7 @@ impl<'a> AioCb<'a> {
SigEvent::from(&self.aiocb.0.aio_sigevent)
}
- fn aio_return_unpinned(self: &mut Self) -> Result<isize> {
+ fn aio_return_unpinned(&mut self) -> Result<isize> {
unsafe {
let p: *mut libc::aiocb = &mut self.aiocb.0;
self.in_progress = false;
@@ -838,6 +838,10 @@ unsafe impl<'a> Sync for LioCb<'a> {}
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
impl<'a> LioCb<'a> {
+ pub fn is_empty(&self) -> bool {
+ self.aiocbs.is_empty()
+ }
+
/// Return the number of individual [`AioCb`]s contained.
pub fn len(&self) -> usize {
self.aiocbs.len()