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

Function rel_under_root

src/hooks/mod.rs:451–465  ·  view source on GitHub ↗
(root: &Path, abs: &Path)

Source from the content-addressed store, hash-verified

449}
450
451fn rel_under_root(root: &Path, abs: &Path) -> Option<String> {
452 let stripped = abs.strip_prefix(root).ok()?;
453 if stripped.as_os_str().is_empty() {
454 return None;
455 }
456 if stripped.components().any(|component| {
457 matches!(
458 component,
459 Component::ParentDir | Component::RootDir | Component::Prefix(_)
460 )
461 }) {
462 return None;
463 }
464 Some(stripped.to_string_lossy().replace('\\', "/"))
465}
466
467fn text_field(value: &Value, keys: &[&str]) -> Option<String> {
468 keys.iter()

Callers 4

claude_edit_rel_pathsFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected