Skip to main content

truncate_path_middle

Function truncate_path_middle 

Source
pub fn truncate_path_middle(path: &str, max_len: usize) -> String
Expand description

Truncate a file path in the middle, preferring to break at path separators.

Keeps a head and a tail joined by , choosing break points at / so the most recognizable parts of the path (directories / file name) are preserved. This is the path-aware sibling of truncate_middle, shared so the same display logic is not re-implemented per crate.