diff options
| author | A Farzat <a@farzat.xyz> | 2026-06-06 03:22:07 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-06-06 03:39:39 +0300 |
| commit | e26d589dc129faa3018546239fb2ac4675f5753c (patch) | |
| tree | c662ad8ef9a845b522456d66604f71573ab9b19e /src/util/path_display.rs | |
| parent | ff88ff447bc5099146bc5d293ece56133467fb83 (diff) | |
| download | repo2markdown-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.rs | 9 |
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() +} |
