From 591053c55753e00341bd739c00f9ff09ae6e8141 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 10 Feb 2025 18:17:40 +0200 Subject: Remove typechecking --- log_db/src/config.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'log_db/src/config.rs') diff --git a/log_db/src/config.rs b/log_db/src/config.rs index 2ed11c9..5b3cf26 100644 --- a/log_db/src/config.rs +++ b/log_db/src/config.rs @@ -1,7 +1,7 @@ use super::*; pub struct Schema { - pub fields: Vec<(F, Type)>, + pub fields: Vec, pub primary_key: F, pub secondary_keys: Vec, } @@ -12,7 +12,7 @@ pub struct ConfigBuilder { write_durability: Option, read_consistency: Option, - schema: Option>, + fields: Option>, primary_key: Option, secondary_keys: Option>, from_record: Option) -> T>, @@ -29,7 +29,7 @@ impl ConfigBuilder { write_durability: None, read_consistency: None, - schema: None, + fields: None, primary_key: None, secondary_keys: None, from_record: None, @@ -71,8 +71,8 @@ impl ConfigBuilder { self } - pub fn schema(mut self, schema: Vec<(F, Type)>) -> Self { - self.schema = Some(schema); + pub fn fields(mut self, schema: Vec) -> Self { + self.fields = Some(schema); self } @@ -98,7 +98,7 @@ impl ConfigBuilder { pub fn initialize(self) -> DBResult> { let schema = self - .schema + .fields .ok_or_else(|| DBError::ValidationError("Schema not set".to_string()))?; let primary_key = self .primary_key @@ -135,7 +135,7 @@ impl ConfigBuilder { #[derive(Clone)] pub struct Config { - pub schema: Vec<(F, Type)>, + pub schema: Vec, pub primary_key: F, pub secondary_keys: Vec, pub from_record: fn(Vec) -> T, -- cgit v1.3