MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / snap_path_for

Function snap_path_for

nodedb-cluster/src/install_snapshot/finalize.rs:125–133  ·  view source on GitHub ↗

Derive the `.snap` path from the `.partial` path (same directory, stem only).

(partial: &std::path::Path)

Source from the content-addressed store, hash-verified

123
124/// Derive the `.snap` path from the `.partial` path (same directory, stem only).
125fn snap_path_for(partial: &std::path::Path) -> PathBuf {
126 let parent = partial
127 .parent()
128 .unwrap_or_else(|| std::path::Path::new("."));
129 let stem = partial
130 .file_stem()
131 .unwrap_or_else(|| std::ffi::OsStr::new("unknown"));
132 parent.join(format!("{}.snap", stem.to_string_lossy()))
133}

Callers 1

commitFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected