From 775937e959e4cf154f8dacd66d363006a776ce3c Mon Sep 17 00:00:00 2001 From: marvin-j97 Date: Fri, 20 Dec 2024 15:40:09 +0100 Subject: [PATCH] fix example --- examples/tx-ssi-partition-move/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/tx-ssi-partition-move/src/main.rs b/examples/tx-ssi-partition-move/src/main.rs index 358927b..714e0ab 100644 --- a/examples/tx-ssi-partition-move/src/main.rs +++ b/examples/tx-ssi-partition-move/src/main.rs @@ -33,12 +33,13 @@ fn main() -> fjall::Result<()> { // Something like SingleDelete https://github.com/facebook/rocksdb/wiki/Single-Delete // would be good for this type of workload if let Some((key, value)) = tx.first_key_value(&src)? { - tx.remove(&src, &key); - tx.insert(&dst, &key, &value); + let task_id = std::str::from_utf8(&key).unwrap().to_owned(); + + tx.remove(&src, key.clone()); + tx.insert(&dst, key, value); tx.commit()?.ok(); - let task_id = std::str::from_utf8(&key).unwrap(); println!("consumer {idx} moved {task_id}"); let ms = rng.gen_range(10..100);