Skip to main content

validate_relative_path

Function validate_relative_path 

Source
pub fn validate_relative_path(path: &str) -> Result<PathBuf, FsError>
Expand description

Validate that a relative path doesn’t contain traversal components.

Rejects (not clamps) .. and absolute paths. Use this for I/O operations where traversal is never valid.

Returns the validated path as a PathBuf on success.