cargo_util::paths

Function strip_prefix_canonical

source
pub fn strip_prefix_canonical<P: AsRef<Path>>(
    path: P,
    base: P,
) -> Result<PathBuf, StripPrefixError>
Expand description

Strips base from path.

This canonicalizes both paths before stripping. This is useful if the paths are obtained in different ways, and one or the other may or may not have been normalized in some way.