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

Function as_urn

atomic-canonical/src/lift.rs:256–262  ·  view source on GitHub ↗

Wrap a local id into `urn:atomic: : ` unless already a urn.

(kind: &str, local: &str)

Source from the content-addressed store, hash-verified

254
255/// Wrap a local id into `urn:atomic:<kind>:<local>` unless already a urn.
256fn as_urn(kind: &str, local: &str) -> String {
257 if local.starts_with("urn:atomic:") {
258 local.to_string()
259 } else {
260 format!("urn:atomic:{kind}:{local}")
261 }
262}
263
264fn slug(s: &str) -> String {
265 s.to_lowercase()

Callers 5

lift_acFunction · 0.85
lift_taskFunction · 0.85
lift_scopeFunction · 0.85
lift_constraintFunction · 0.85
lift_refFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected