Fix dumb clippy errors

This commit is contained in:
Diego Reis
2025-04-03 16:25:13 -03:00
parent 66e12e1c2d
commit 79f8b83cbe
7 changed files with 22 additions and 6 deletions

View File

@@ -176,4 +176,8 @@ impl limbo_core::IO for IO {
fn generate_random_number(&self) -> i64 {
todo!();
}
fn get_memory_io(&self) -> Option<Arc<limbo_core::MemoryIO>> {
todo!()
}
}

View File

@@ -305,6 +305,10 @@ impl limbo_core::IO for PlatformIO {
let random_f64 = Math_random();
(random_f64 * i64::MAX as f64) as i64
}
fn get_memory_io(&self) -> Option<Arc<limbo_core::MemoryIO>> {
None // TODO: Make sure if memory isn't needed here
}
}
#[wasm_bindgen]

View File

@@ -5,12 +5,16 @@ use std::sync::Arc;
use tracing::{debug, trace};
use super::MemoryIO;
pub struct GenericIO {}
pub struct GenericIO {
memory_io: Arc<MemoryIO>,
}
impl GenericIO {
pub fn new() -> Result<Self> {
debug!("Using IO backend 'generic'");
Ok(Self {})
Ok(Self {
memory_io: Arc::new(MemoryIO::new()),
})
}
}

View File

@@ -11,7 +11,9 @@ pub struct WindowsIO {
impl WindowsIO {
pub fn new() -> Result<Self> {
debug!("Using IO backend 'syscall'");
Ok(Self {})
Ok(Self {
memory_io: Arc::new(MemoryIO::new()),
})
}
}
@@ -28,7 +30,6 @@ impl IO for WindowsIO {
.open(path)?;
Ok(Arc::new(WindowsFile {
file: RefCell::new(file),
memory_io: Arc::new(MemoryIO::new()),
}))
}

View File

@@ -1,4 +1,3 @@
#[cfg(feature = "fs")]
use crate::error::LimboError;
use crate::{io::Completion, Buffer, Result};
use std::{cell::RefCell, sync::Arc};

View File

@@ -4551,7 +4551,7 @@ pub fn op_open_ephemeral(
let mv_cursor = match state.mv_tx_id {
Some(tx_id) => {
let table_id = root_page as u64;
let mv_store = mv_store.as_ref().unwrap().clone();
let mv_store = mv_store.unwrap().clone();
let mv_cursor = Rc::new(RefCell::new(
MvCursor::new(mv_store.clone(), tx_id, table_id).unwrap(),
));

View File

@@ -97,4 +97,8 @@ impl IO for SimulatorIO {
fn generate_random_number(&self) -> i64 {
self.rng.borrow_mut().next_u64() as i64
}
fn get_memory_io(&self) -> Option<Arc<limbo_core::MemoryIO>> {
todo!()
}
}