fn fixup_rel_path()

in src/path_rewriting.rs [118:128]


fn fixup_rel_path(source_dir: Option<&Path>, abs_path: &Path, rel_path: PathBuf) -> PathBuf {
    if let Some(ref source_dir) = source_dir {
        if abs_path.starts_with(source_dir) {
            return abs_path.strip_prefix(source_dir).unwrap().to_path_buf();
        } else if !rel_path.is_relative() {
            return abs_path.to_owned();
        }
    }

    rel_path
}