MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / normalize_memory_path

Function normalize_memory_path

atomic-cli/src/commands/vault/memory.rs:258–269  ·  view source on GitHub ↗

Normalize a user-provided memory name to a full vault path. Ensures the path starts with `memory/` and ends with `.md`.

(name: &str)

Source from the content-addressed store, hash-verified

256///
257/// Ensures the path starts with `memory/` and ends with `.md`.
258fn normalize_memory_path(name: &str) -> String {
259 let name = if name.starts_with("memory/") {
260 name.to_string()
261 } else {
262 format!("memory/{}", name)
263 };
264 if name.ends_with(".md") {
265 name
266 } else {
267 format!("{}.md", name)
268 }
269}
270
271// Tests
272

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected