pub fn search_prefix(prefix: &Path) -> Result<impl Iterator<Item = PathBuf>, PatternError> {
    let prefix_path = PathBuf::from(format!("{}*", prefix.to_str().unwrap()));

    Ok(glob::glob(prefix_path.to_str().unwrap())?
        .filter_map(Result::ok)
        .map(move |p| {
            if let Some(merged) = merge_prefix_with_completion(prefix_path.as_path(), p.as_path()) {
                merged
            } else {
                p
            }
        }))
}
/// Search the file system for paths with a given prefix allowing for wildcards. The returns
/// `pathBuf`s are normalized (meaning any `.` and `..` are stripped out.
///
/// If any error is encountered while reading a file, that file is ignored.
Search the file system for paths with a given prefix allowing for wildcards.

If any error is encountered while reading a file, that file is ignored.
Search the file system for paths with a given prefix allowing for wildcards . If any error is encountered while reading a file that file is ignored .
pub fn search_prefix(prefix: &Path) -> Result<impl Iterator<Item = PathBuf>, PatternError> {
    let prefix_path = PathBuf::from(format!("{}*", prefix.to_str().unwrap()));
    Ok(glob::glob(prefix_path.to_str().unwrap())?
        .filter_map(Result::ok)
        .map(move |p| {
            if let Some(merged) = merge_prefix_with_completion(prefix_path.as_path(), p.as_path()) {
                merged
            } else {
                p
            }
        }))
}
pub fn search_prefix ( prefix : & Path ) -> Result < impl Iterator < Item = PathBuf > , PatternError > { let prefix_path = PathBuf :: from ( format ! ( " " prefix to_str ( ) unwrap ( ) ) ) ; Ok ( glob :: glob ( prefix_path . to_str ( ) . unwrap ( ) ) ? . filter_map ( Result :: ok ) . map ( move | p | { if let Some ( merged ) = merge_prefix_with_completion ( prefix_path . as_path ( ) , p . as_path ( ) ) { merged } else { p } } ) ) }
Search the file system for paths with a given prefix allowing for wildcards.
Search the file system for paths with a given prefix allowing for wildcards .
prefix
&Path