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

Function parts

atomic-cli/src/commands/intent/list.rs:132–141  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

130/// Invalid suffixes remain deterministic and group with their own prefix.
131fn compare_human_keys(a: &str, b: &str) -> std::cmp::Ordering {
132 fn parts(key: &str) -> (&str, Option<&str>) {
133 let split = key
134 .rfind("::")
135 .map(|i| i + 2)
136 .or_else(|| key.rfind('-').map(|i| i + 1));
137 match split {
138 Some(i) => (&key[..i], Some(&key[i..])),
139 None => (key, None),
140 }
141 }
142 fn numeric(s: &str) -> Option<&str> {
143 if s.is_empty() || !s.bytes().all(|b| b.is_ascii_digit()) {
144 return None;

Callers 1

compare_human_keysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected