From 79f8b83cbe17457125cf05d953bb445b7dd04db3 Mon Sep 17 00:00:00 2001 From: Diego Reis Date: Thu, 3 Apr 2025 16:25:13 -0300 Subject: [PATCH] Fix dumb clippy errors --- bindings/javascript/src/lib.rs | 4 ++++ bindings/wasm/lib.rs | 4 ++++ core/io/generic.rs | 8 ++++++-- core/io/windows.rs | 5 +++-- core/storage/database.rs | 1 - core/vdbe/execute.rs | 2 +- simulator/runner/io.rs | 4 ++++ 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/bindings/javascript/src/lib.rs b/bindings/javascript/src/lib.rs index a9c0d72a5..eaa2fc3a6 100644 --- a/bindings/javascript/src/lib.rs +++ b/bindings/javascript/src/lib.rs @@ -176,4 +176,8 @@ impl limbo_core::IO for IO { fn generate_random_number(&self) -> i64 { todo!(); } + + fn get_memory_io(&self) -> Option> { + todo!() + } } diff --git a/bindings/wasm/lib.rs b/bindings/wasm/lib.rs index 91680dc96..6b4173c90 100644 --- a/bindings/wasm/lib.rs +++ b/bindings/wasm/lib.rs @@ -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> { + None // TODO: Make sure if memory isn't needed here + } } #[wasm_bindgen] diff --git a/core/io/generic.rs b/core/io/generic.rs index b17a0ea5a..03d5fdd3d 100644 --- a/core/io/generic.rs +++ b/core/io/generic.rs @@ -5,12 +5,16 @@ use std::sync::Arc; use tracing::{debug, trace}; use super::MemoryIO; -pub struct GenericIO {} +pub struct GenericIO { + memory_io: Arc, +} impl GenericIO { pub fn new() -> Result { debug!("Using IO backend 'generic'"); - Ok(Self {}) + Ok(Self { + memory_io: Arc::new(MemoryIO::new()), + }) } } diff --git a/core/io/windows.rs b/core/io/windows.rs index 7c3c2e015..af36119d0 100644 --- a/core/io/windows.rs +++ b/core/io/windows.rs @@ -11,7 +11,9 @@ pub struct WindowsIO { impl WindowsIO { pub fn new() -> Result { 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()), })) } diff --git a/core/storage/database.rs b/core/storage/database.rs index 33ca2ac18..cf8b57d8e 100644 --- a/core/storage/database.rs +++ b/core/storage/database.rs @@ -1,4 +1,3 @@ -#[cfg(feature = "fs")] use crate::error::LimboError; use crate::{io::Completion, Buffer, Result}; use std::{cell::RefCell, sync::Arc}; diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index fb23141d0..3ad0a91f8 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -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(), )); diff --git a/simulator/runner/io.rs b/simulator/runner/io.rs index d1c280b4e..0a7ff3b3a 100644 --- a/simulator/runner/io.rs +++ b/simulator/runner/io.rs @@ -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> { + todo!() + } }