pub fn join_path(base: &str, other: &str) -> String
Expand description
Joins paths of various platforms.
This attempts to detect Windows or Unix paths and joins with the correct directory separator. Also, trailing directory separators are detected in the base string and empty paths are handled correctly.
ยงExamples
Join a relative UNIX path:
assert_eq!(symbolic_common::join_path("/a/b", "c/d"), "/a/b/c/d");
Join a Windows drive letter path path:
assert_eq!(symbolic_common::join_path("C:\\a", "b\\c"), "C:\\a\\b\\c");
If the right-hand side is an absolute path, it replaces the left-hand side:
assert_eq!(symbolic_common::join_path("/a/b", "/c/d"), "/c/d");