capnp_store: remove dead code, consolidate CRUD API
Dead code removed: - rebuild_uuid_index (never called, index built during load) - node_weight inherent method (all callers use StoreView trait) - node_community (no callers) - state_json_path (no callers) - log_retrieval, log_retrieval_append (no callers; only _static is used) - memory_dir_pub wrapper (just make memory_dir pub directly) API consolidation: - insert_node eliminated — callers use upsert_node (same behavior for new nodes, plus handles re-upsert gracefully) AnyView StoreView dispatch compressed to one line per method (also removes UFCS workaround that was needed when inherent node_weight shadowed the trait method). -69 lines net.
This commit is contained in:
parent
0bce6aac3c
commit
70a5f05ce0
3 changed files with 11 additions and 80 deletions
|
|
@ -1357,7 +1357,7 @@ fn cmd_import(args: &[String]) -> Result<(), String> {
|
|||
let resolved = if path.exists() {
|
||||
path
|
||||
} else {
|
||||
let mem_path = capnp_store::memory_dir_pub().join(arg);
|
||||
let mem_path = capnp_store::memory_dir().join(arg);
|
||||
if !mem_path.exists() {
|
||||
eprintln!("File not found: {}", arg);
|
||||
continue;
|
||||
|
|
@ -1401,7 +1401,7 @@ fn cmd_export(args: &[String]) -> Result<(), String> {
|
|||
}).collect()
|
||||
};
|
||||
|
||||
let mem_dir = capnp_store::memory_dir_pub();
|
||||
let mem_dir = capnp_store::memory_dir();
|
||||
|
||||
for file_key in &targets {
|
||||
match store.export_to_markdown(file_key) {
|
||||
|
|
@ -1455,7 +1455,7 @@ fn cmd_journal_write(args: &[String]) -> Result<(), String> {
|
|||
node.source_ref = src;
|
||||
}
|
||||
|
||||
store.insert_node(node)?;
|
||||
store.upsert_node(node)?;
|
||||
store.save()?;
|
||||
|
||||
let word_count = text.split_whitespace().count();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue