diff --git a/core/io/io_uring.rs b/core/io/io_uring.rs index c9cfaaa9b..e745bb168 100644 --- a/core/io/io_uring.rs +++ b/core/io/io_uring.rs @@ -535,13 +535,9 @@ impl IO for UringIO { "fixed buffer length must be logical block aligned" ); let mut inner = self.inner.borrow_mut(); - let slot = inner - .free_arenas - .iter() - .position(|e| e.is_none()) - .ok_or_else(|| { - crate::error::CompletionError::UringIOError("no free fixed buffer slots") - })?; + let slot = inner.free_arenas.iter().position(|e| e.is_none()).ok_or( + crate::error::CompletionError::UringIOError("no free fixed buffer slots"), + )?; unsafe { inner.ring.ring.submitter().register_buffers_update( slot as u32, diff --git a/core/io/windows.rs b/core/io/windows.rs index dcc42474f..9f5cb96bd 100644 --- a/core/io/windows.rs +++ b/core/io/windows.rs @@ -1,4 +1,3 @@ -use super::MemoryIO; use crate::{Clock, Completion, File, Instant, LimboError, OpenFlags, Result, IO}; use parking_lot::RwLock; use std::io::{Read, Seek, Write}; @@ -90,7 +89,7 @@ impl File for WindowsFile { #[instrument(err, skip_all, level = Level::TRACE)] fn sync(&self, c: Completion) -> Result { let file = self.file.write(); - file.sync_all().map_err(LimboError::IOError)?; + file.sync_all()?; c.complete(0); Ok(c) } @@ -98,7 +97,7 @@ impl File for WindowsFile { #[instrument(err, skip_all, level = Level::TRACE)] fn truncate(&self, len: usize, c: Completion) -> Result { let file = self.file.write(); - file.set_len(len as u64).map_err(LimboError::IOError)?; + file.set_len(len as u64)?; c.complete(0); Ok(c) } diff --git a/core/lib.rs b/core/lib.rs index b1e92cc03..c7226818f 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -1309,9 +1309,9 @@ impl Connection { Ok(result) => result, // on windows, zero read will trigger UnexpectedEof #[cfg(target_os = "windows")] - Err(LimboError::IOError(e)) if e.kind() == std::io::ErrorKind::UnexpectedEof => { - return Ok(false) - } + Err(LimboError::CompletionError(CompletionError::IOError( + std::io::ErrorKind::UnexpectedEof, + ))) => return Ok(false), Err(err) => return Err(err), };