From 19905c60c660e891cc6cd32d1d9fca0a2bb25ee4 Mon Sep 17 00:00:00 2001 From: Kould Date: Tue, 16 Jul 2024 17:26:12 +0800 Subject: [PATCH] chore: code fmt --- src/lib.rs | 21 ++++++++------------- src/stream/merge.rs | 4 ++-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ad562b61..c9fc95ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,28 +13,23 @@ mod transaction; mod version; use std::{ - collections::VecDeque, - io, mem, - ops::Bound, - sync::Arc, + collections::VecDeque, io, marker::PhantomData, mem, ops::Bound, path::PathBuf, sync::Arc, }; -use std::marker::PhantomData; -use std::path::PathBuf; + use async_lock::{RwLock, RwLockReadGuard}; use futures_core::Stream; use futures_util::StreamExt; -use parquet::errors::ParquetError; use inmem::{immutable::Immutable, mutable::Mutable}; use oracle::Timestamp; +use parquet::errors::ParquetError; use record::Record; use crate::{ executor::Executor, fs::{FileId, FileType}, + stream::{merge::MergeStream, Entry, ScanStream}, version::Version, }; -use crate::stream::merge::MergeStream; -use crate::stream::{Entry, ScanStream}; #[derive(Debug)] pub struct DbOption { @@ -195,7 +190,7 @@ where ts: Timestamp, ) -> Result, ParquetError>>, ParquetError> where - E: Executor + E: Executor, { let mut streams = Vec::>::with_capacity(self.immutables.len() + 1); streams.push(self.mutable.scan((lower, uppwer), ts).into()); @@ -225,11 +220,11 @@ pub(crate) mod tests { use once_cell::sync::Lazy; use crate::{ + executor::Executor, inmem::immutable::tests::TestImmutableArrays, record::{internal::InternalRecordRef, RecordRef}, Record, DB, }; - use crate::executor::Executor; #[derive(Debug, PartialEq, Eq)] pub struct Test { @@ -312,8 +307,8 @@ pub(crate) mod tests { } } - pub(crate) async fn get_test_record_batch() -> RecordBatch { - let db = DB::empty(); + pub(crate) async fn get_test_record_batch() -> RecordBatch { + let db: DB = DB::empty(); db.write( Test { diff --git a/src/stream/merge.rs b/src/stream/merge.rs index 4627fd50..227cf507 100644 --- a/src/stream/merge.rs +++ b/src/stream/merge.rs @@ -136,9 +136,9 @@ mod tests { use std::ops::Bound; use futures_util::StreamExt; - use crate::executor::tokio::TokioExecutor; + use super::MergeStream; - use crate::inmem::mutable::Mutable; + use crate::{executor::tokio::TokioExecutor, inmem::mutable::Mutable}; #[tokio::test] async fn merge_mutable() {