Skip to main content

relative_display

Function relative_display 

Source
pub fn relative_display<'a>(path: &'a Path, base: &Path) -> &'a Path
Expand description

Compute a display-friendly relative path by stripping a base prefix.

Returns the relative portion if path is under base, otherwise returns the original path unchanged. Used by diff headers, search results, and JSON output so users see src/main.rs instead of /home/user/project/src/main.rs.