summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/mod.rs1
-rw-r--r--src/util/path_display.rs9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/util/mod.rs b/src/util/mod.rs
new file mode 100644
index 0000000..1ba817e
--- /dev/null
+++ b/src/util/mod.rs
@@ -0,0 +1 @@
+pub mod path_display;
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()
+}