Skip to main content

ensure_inside

Function ensure_inside 

Source
pub fn ensure_inside(
    root: impl AsRef<Path>,
    path: impl AsRef<Path>,
) -> Result<PathBuf, PathError>
Expand description

Normalize both paths and ensure path stays inside root.

Returns the normalized path on success.

§Filesystem access

No.

§Security

Not symlink-safe. See module documentation.