diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-23 18:56:52 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-23 18:56:52 +0100 |
commit | 3ca7df883ab71c278086a593ed25699ce6b1a608 (patch) | |
tree | f8f9d58ecc638c8d1d83ad029cc021e81c3cb533 /import | |
parent | 31675068c5ef1af1c4ae50693ace7ab1b6890393 (diff) | |
download | jellything-3ca7df883ab71c278086a593ed25699ce6b1a608.tar jellything-3ca7df883ab71c278086a593ed25699ce6b1a608.tar.bz2 jellything-3ca7df883ab71c278086a593ed25699ce6b1a608.tar.zst |
show node path
Diffstat (limited to 'import')
-rw-r--r-- | import/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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<String>) -> 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 |