Skip to main content

append_safe_relative_components

Function append_safe_relative_components 

Source
pub fn append_safe_relative_components(
    base: PathBuf,
    remainder: &Path,
) -> Result<PathBuf, RelativePathNormalizeError>
Expand description

Append unresolved remainder components onto a resolved base.

Matches CLI canonicalize_existing_ancestor remainder handling:

  • Normal → push
  • CurDir → ignore
  • ParentDir / Prefix / RootDir → refuse (escape / re-root)

Callers supply the already-canonical existing ancestor as base and the non-existing tail as remainder (from path.strip_prefix(ancestor)).