mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-22 16:35:30 +01:00
clippy
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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<Completion> {
|
||||
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<Completion> {
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user