fn merge_prefix_with_completion(original_path: &Path, new: &Path) -> Option<PathBuf> {
    if let Some(first) = original_path.components().next() {
        if matches!(first, Component::CurDir) {
            let merged: PathBuf = vec![first.as_os_str(), new.as_os_str()].iter().collect();

            return Some(merged);
        }
    }

    None
}
/// Merge the prefix path with the completion path to restore any path
/// component lost during processing.
Merge the prefix path with the completion path to restore any path
component lost during processing.
Merge the prefix path with the completion path to restore any path component lost during processing .
fn merge_prefix_with_completion(original_path: &Path, new: &Path) -> Option<PathBuf> {
    if let Some(first) = original_path.components().next() {
        if matches!(first, Component::CurDir) {
            let merged: PathBuf = vec![first.as_os_str(), new.as_os_str()].iter().collect();
            return Some(merged);
        }
    }
    None
}
fn merge_prefix_with_completion ( original_path : & Path , new : & Path ) -> Option < PathBuf > { if let Some ( first ) = original_path . components ( ) . next ( ) { if matches ! ( first Component CurDir ) { let merged : PathBuf = vec ! [ first as_os_str ( ) new as_os_str ( ) ] . iter ( ) . collect ( ) ; return Some ( merged ) ; } } None }
Merge the prefix path with the completion path to restore any path
component lost during processing.
Merge the prefix path with the completion path to restore any path component lost during processing .
original_path
&Path
new
&Path