summaryrefslogtreecommitdiff
path: root/src/util/path_display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/path_display.rs')
-rw-r--r--src/util/path_display.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/path_display.rs b/src/util/path_display.rs
new file mode 100644
index 0000000..e9dca4b
--- /dev/null
+++ b/src/util/path_display.rs
@@ -0,0 +1,9 @@
+use std::path::Path;
+
+pub fn display_path(path: &Path) -> String {
+ let s = format!("{:?}", path);
+ s.strip_prefix('"')
+ .and_then(|s| s.strip_suffix('"'))
+ .unwrap_or(&s)
+ .to_string()
+}