From 69acfefc0c70eac9dc410cbb947cb56bfb5ca8c4 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Thu, 11 May 2023 08:46:44 -0400 Subject: [PATCH] Added commit data. --- src/morethantext/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/morethantext/mod.rs b/src/morethantext/mod.rs index 99c019e..c4b35a8 100644 --- a/src/morethantext/mod.rs +++ b/src/morethantext/mod.rs @@ -389,7 +389,7 @@ struct CacheQuery { struct CacheCommit { reply: Sender, - // data: DataType, + data: DataType, } impl CacheCommit { @@ -399,7 +399,7 @@ impl CacheCommit { _ => return Err(MTTError::from_code(ErrorCode::InvalidCommitData)), } Ok(Self { - // data: data, + data: data, reply: channel, }) } @@ -412,7 +412,13 @@ mod commits { fn create() -> Result<(), MTTError> { let (s, _) = unbounded(); match CacheCommit::new(DataType::new("store"), s) { - Ok(_) => Ok(()), + Ok(output) => match output.data { + DataType::DBMap(_) => Ok(()), + _ => Err(MTTError::new(format!( + "{:?} should have been DBMap", + output.data + ))), + }, Err(err) => Err(err), } }