summaryrefslogtreecommitdiff
path: root/src/util/path_display.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-06-06 03:22:07 +0300
committerA Farzat <a@farzat.xyz>2026-06-06 03:39:39 +0300
commite26d589dc129faa3018546239fb2ac4675f5753c (patch)
treec662ad8ef9a845b522456d66604f71573ab9b19e /src/util/path_display.rs
parentff88ff447bc5099146bc5d293ece56133467fb83 (diff)
downloadrepo2markdown-e26d589dc129faa3018546239fb2ac4675f5753c.tar.gz
repo2markdown-e26d589dc129faa3018546239fb2ac4675f5753c.zip
Move render_filename to utils as display_path
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()
+}