From 9f2faae49a293a8008eb820fae6006ab98e6b983 Mon Sep 17 00:00:00 2001 From: Ambrosia Date: Sun, 12 Sep 2021 14:59:51 +0100 Subject: [PATCH] fix: update index on disk after deleting in ActionKV2 --- ch7/ch7-actionkv2/src/akv_disk.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ch7/ch7-actionkv2/src/akv_disk.rs b/ch7/ch7-actionkv2/src/akv_disk.rs index 0fcbd421..73b05932 100644 --- a/ch7/ch7-actionkv2/src/akv_disk.rs +++ b/ch7/ch7-actionkv2/src/akv_disk.rs @@ -62,7 +62,10 @@ fn main() { } } - "delete" => a.delete(key).unwrap(), + "delete" => { + a.delete(key).unwrap(); + store_index_on_disk(&mut a, INDEX_KEY); <2> + } "insert" => { let value = maybe_value.expect(&USAGE).as_ref();