From 308f643778aa7e1bc4a1fe0936f955f3f1e2b4a1 Mon Sep 17 00:00:00 2001 From: Kould <2435992353@qq.com> Date: Sun, 10 Sep 2023 01:38:25 +0800 Subject: [PATCH] fix: test --- examples/mvcc.rs | 2 +- src/kernel/lsm/mvcc.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mvcc.rs b/examples/mvcc.rs index a1b2251..4499474 100644 --- a/examples/mvcc.rs +++ b/examples/mvcc.rs @@ -24,7 +24,7 @@ async fn main() -> Result<(), KernelError> { println!("Read key_1 on the transaction: {:?}", tx.get(b"key_1")?); println!("Set KeyValue on the transaction -> (key_2, value_2)"); - tx.set(b"key_2", Bytes::copy_from_slice(b"value_2")); + tx.set(Bytes::copy_from_slice(b"key_2"), Bytes::copy_from_slice(b"value_2")); println!("Read key_2 on the transaction: {:?}", tx.get(b"key_2")?); diff --git a/src/kernel/lsm/mvcc.rs b/src/kernel/lsm/mvcc.rs index dd8a40e..cdb5413 100644 --- a/src/kernel/lsm/mvcc.rs +++ b/src/kernel/lsm/mvcc.rs @@ -320,7 +320,7 @@ mod tests { let mut tx_1 = kv_store.new_transaction().await; for i in 100..times { - tx_1.set(&vec_kv[i].0, vec_kv[i].1.clone()); + tx_1.set(vec_kv[i].0.clone(), vec_kv[i].1.clone()); } tx_1.remove(&vec_kv[times - 1].0)?;