MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / normalize_mount_target

Function normalize_mount_target

crates/openshell-core/src/driver_mounts.rs:118–123  ·  view source on GitHub ↗

Normalize a validated container-side mount target for semantic comparison.

(target: &str)

Source from the content-addressed store, hash-verified

116
117/// Normalize a validated container-side mount target for semantic comparison.
118pub fn normalize_mount_target(target: &str) -> String {
119 if target == "/" {
120 return target.to_string();
121 }
122 target.trim_end_matches('/').to_string()
123}
124
125fn path_is_or_under(path: &Path, parent: &Path) -> bool {
126 path == parent || path.starts_with(parent)

Callers 4

podman_user_mountsFunction · 0.85
docker_bind_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected