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

Function normalize

atomic-semantic/src/relationships.rs:183–194  ·  view source on GitHub ↗
(path: PathBuf)

Source from the content-addressed store, hash-verified

181}
182
183fn normalize(path: PathBuf) -> Option<PathBuf> {
184 let mut result = PathBuf::new();
185 for part in path.components() {
186 match part {
187 Component::Normal(name) => result.push(name),
188 Component::ParentDir if !result.pop() => return None,
189 Component::ParentDir | Component::CurDir => {}
190 _ => return None,
191 }
192 }
193 Some(result)
194}
195
196impl SourceGraph {
197 /// Build from selected semantic facts and the full visible path inventory.

Callers 1

script_candidatesFunction · 0.85

Calls 2

componentsMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected