From c8a979eb4b75d069f7f17eb4ea9bb6f992522486 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sun, 19 Jan 2025 11:34:59 +0200 Subject: [PATCH] core: Move re-exports at top of lib.rs Clean up the code a bit by moving re-exports at the top of lib.rs to make them more visible to the reader. --- core/lib.rs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/core/lib.rs b/core/lib.rs index 4f46fe06e..f2ca7ba9e 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -14,6 +14,22 @@ mod types; mod util; mod vdbe; +pub use error::LimboError; +pub use io::OpenFlags; +pub use io::PlatformIO; +#[cfg(all(feature = "fs", target_family = "unix"))] +pub use io::UnixIO; +#[cfg(all(feature = "fs", target_os = "linux", feature = "io_uring"))] +pub use io::UringIO; +pub use io::{Buffer, Completion, File, MemoryIO, WriteCompletion, IO}; +pub use storage::buffer_pool::BufferPool; +pub use storage::database::DatabaseStorage; +pub use storage::pager::{Page, Pager}; +pub use storage::wal::{CheckpointStatus, Wal, WalFile, WalFileShared}; +pub use types::Value; + +pub type Result = std::result::Result; + #[cfg(not(target_family = "wasm"))] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; @@ -38,29 +54,11 @@ use storage::database::FileStorage; use storage::page_cache::DumbLruPageCache; use storage::pager::allocate_page; use storage::sqlite3_ondisk::{DatabaseHeader, DATABASE_HEADER_SIZE}; -pub use storage::wal::WalFile; -pub use storage::wal::WalFileShared; -pub use types::Value; use util::parse_schema_rows; -pub use error::LimboError; use translate::select::prepare_select_plan; -pub type Result = std::result::Result; use crate::translate::optimizer::optimize_plan; -pub use io::OpenFlags; -pub use io::PlatformIO; -#[cfg(all(feature = "fs", target_family = "unix"))] -pub use io::UnixIO; -#[cfg(all(feature = "fs", target_os = "linux", feature = "io_uring"))] -pub use io::UringIO; -pub use io::{Buffer, Completion, File, MemoryIO, WriteCompletion, IO}; -pub use storage::buffer_pool::BufferPool; -pub use storage::database::DatabaseStorage; -pub use storage::pager::Page; -pub use storage::pager::Pager; -pub use storage::wal::CheckpointStatus; -pub use storage::wal::Wal; pub static DATABASE_VERSION: OnceLock = OnceLock::new(); #[derive(Clone)]