merge_paths

Function merge_paths 

Source
pub fn merge_paths(
    primary: impl AsRef<OsStr>,
    secondary: impl AsRef<OsStr>,
) -> OsString
Expand description

Merge two PATH strings into a single, de-duplicated PATH.

  • Keeps the order of entries from primary.
  • Appends only unseen entries from secondary.
  • Ignores empty components.
  • Returns a platform-correct PATH string (using the OS separator).