summaryrefslogtreecommitdiff
path: root/cli/util/path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/util/path.rs')
-rw-r--r--cli/util/path.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/util/path.rs b/cli/util/path.rs
index 3c848edea..16378e30b 100644
--- a/cli/util/path.rs
+++ b/cli/util/path.rs
@@ -173,6 +173,11 @@ pub fn path_with_stem_suffix(path: &Path, suffix: &str) -> PathBuf {
}
}
+#[cfg_attr(windows, allow(dead_code))]
+pub fn relative_path(from: &Path, to: &Path) -> Option<PathBuf> {
+ pathdiff::diff_paths(to, from)
+}
+
/// Gets if the provided character is not supported on all
/// kinds of file systems.
pub fn is_banned_path_char(c: char) -> bool {