diff options
| author | A Farzat <a@farzat.xyz> | 2026-06-21 11:47:40 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-06-21 11:47:40 +0300 |
| commit | 70dc8d090fd68def5651c28f3fe1ab0d854bee30 (patch) | |
| tree | d94b22ed4a39e8ed2e94ee50feabb9c3e7d193f2 /src | |
| parent | 84b497fe446511ce832afcea30683b8e070bed10 (diff) | |
| download | repo2markdown-70dc8d090fd68def5651c28f3fe1ab0d854bee30.tar.gz repo2markdown-70dc8d090fd68def5651c28f3fe1ab0d854bee30.zip | |
Improve module/function docs in path_display
Diffstat (limited to 'src')
| -rw-r--r-- | src/util/path_display.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util/path_display.rs b/src/util/path_display.rs index d7bd624..78ff989 100644 --- a/src/util/path_display.rs +++ b/src/util/path_display.rs @@ -1,12 +1,15 @@ -//! Path display helpers. +//! Helpers for displaying filesystem paths in generated Markdown. use std::path::Path; /// Converts a path to a Markdown-friendly display string. /// -/// This uses Rust's debug path formatting, then strips surrounding quotes when present. That keeps -/// escaped characters such as newlines and invalid UTF-8 markers visible in generated Markdown -/// headings. +/// The returned string uses Rust's debug-style path formatting so that unusual characters remain +/// visible instead of affecting the Markdown structure. For example, embedded newlines are shown as +/// `\n`, and invalid UTF-8 bytes are escaped. +/// +/// Surrounding quotes added by debug formatting are stripped when present, so ordinary paths remain +/// easy to read. pub fn display_path(path: &Path) -> String { let s = format!("{:?}", path); s.strip_prefix('"') |
