MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / normalize_lexically

Function normalize_lexically

src/hooks/cursor_shell.rs:368–380  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

366}
367
368fn normalize_lexically(path: &Path) -> PathBuf {
369 let mut normalized = PathBuf::new();
370 for component in path.components() {
371 match component {
372 Component::CurDir => {}
373 Component::ParentDir => {
374 normalized.pop();
375 }
376 other => normalized.push(other.as_os_str()),
377 }
378 }
379 normalized
380}
381
382pub(super) fn paths_same(a: &Path, b: &Path) -> bool {
383 match (a.canonicalize(), b.canonicalize()) {

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected