Skip to main content

relative_to

Function relative_to 

Source
pub fn relative_to<'a>(
    root: &Path,
    path: &'a Path,
) -> Result<&'a Path, OutsideRoot>
Expand description

Require path to be lexically below root and return its relative suffix.

This operation is lexical; use resolve_existing when the boundary must also hold after symbolic-link resolution.

ยงErrors

Returns an owned diagnostic when path is not below root.