Skip to content

Commit

Permalink
Removes unused trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mamcx committed Aug 11, 2023
1 parent 9b94319 commit 75b13cc
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions crates/bench/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
use crate::utils::{encode, ResultBench, START_B};
use crate::utils::{encode, START_B};
use clap::ValueEnum;
use std::marker::PhantomData;
use std::ops::Range;

pub trait BuildDb {
fn build(prefill: bool) -> ResultBench<Self>
where
Self: Sized;
}

pub struct Pool<T> {
pub(crate) instance: u8,
pub(crate) prefill: bool,
_x: PhantomData<T>,
}

impl<T: BuildDb> Pool<T> {
pub fn new(prefill: bool) -> ResultBench<Self> {
Ok(Self {
instance: 0,
prefill,
_x: Default::default(),
})
}

#[allow(clippy::should_implement_trait)]
pub fn next(&mut self) -> ResultBench<T> {
self.instance += 1;
T::build(self.prefill)
}
}

#[derive(Debug)]
pub struct Data {
pub(crate) a: i32,
Expand Down

0 comments on commit 75b13cc

Please sign in to comment.