From 3ca7df883ab71c278086a593ed25699ce6b1a608 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 23 Jan 2024 18:56:52 +0100 Subject: show node path --- import/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'import/src') diff --git a/import/src/lib.rs b/import/src/lib.rs index bf3c48d..fd555b7 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -139,11 +139,13 @@ pub fn generate_node_paths(db: &DataAcid) -> anyhow::Result<()> { fn traverse(db: &DataAcid, c: String, mut path: Vec) -> anyhow::Result<()> { let node = { let txn = db.inner.begin_write()?; - let table = txn.open_table(T_NODE)?; + let mut table = txn.open_table(T_NODE)?; let mut node = table .get(&*c)? - .ok_or(anyhow!("missing child when generating paths: {c:?} at {path:?}"))? + .ok_or(anyhow!( + "missing child when generating paths: {c:?} at {path:?}" + ))? .value() .0; @@ -151,6 +153,8 @@ pub fn generate_node_paths(db: &DataAcid) -> anyhow::Result<()> { node.public.path = path.clone(); } + table.insert(c.as_str(), Ser(node.clone()))?; + drop(table); txn.commit()?; node -- cgit v1.2.3-70-g09d2