fn collect_protos(proto_paths: &[String], protos: &mut Vec<PathBuf>) {
    for proto_path in proto_paths {
        protos.append(
            &mut WalkDir::new(proto_path)
                .into_iter()
                .filter_map(|e| e.ok())
                .filter(|e| {
                    e.file_type().is_file()
                        && e.path().extension().is_some()
                        && e.path().extension().unwrap() == "proto"
                })
                .map(|e| e.into_path())
                .collect(),
        );
    }
}
/// collect_protos walks every path in `proto_paths` and recursively locates all .proto
/// files in each path's subdirectories, adding the full path of each file to `protos`
///
/// Any errors encountered will cause failure for the path provided to WalkDir::new()
collect_protos walks every path in `proto_paths` and recursively locates all .proto
files in each path's subdirectories, adding the full path of each file to `protos`

Any errors encountered will cause failure for the path provided to WalkDir::new()
collect_protos walks every path in ` proto_paths ` and recursively locates all . proto files in each path ' s subdirectories adding the full path of each file to ` protos ` Any errors encountered will cause failure for the path provided to WalkDir :: new ()
fn collect_protos(proto_paths: &[String], protos: &mut Vec<PathBuf>) {
    for proto_path in proto_paths {
        protos.append(
            &mut WalkDir::new(proto_path)
                .into_iter()
                .filter_map(|e| e.ok())
                .filter(|e| {
                    e.file_type().is_file()
                        && e.path().extension().is_some()
                        && e.path().extension().unwrap() == "proto"
                })
                .map(|e| e.into_path())
                .collect(),
        );
    }
}
fn collect_protos ( proto_paths : & [ String ] , protos : & mut Vec < PathBuf > ) { for proto_path in proto_paths { protos . append ( & mut WalkDir :: new ( proto_path ) . into_iter ( ) . filter_map ( | e | e . ok ( ) ) . filter ( | e | { e . file_type ( ) . is_file ( ) && e . path ( ) . extension ( ) . is_some ( ) && e . path ( ) . extension ( ) . unwrap ( ) == " " } ) . map ( | e | e . into_path ( ) ) . collect ( ) , ) ; } }
collect_protos walks every path in `proto_paths` and recursively locates all .proto
files in each path's subdirectories, adding the full path of each file to `protos`
collect_protos walks every path in ` proto_paths ` and recursively locates all . proto files in each path ' s subdirectories adding the full path of each file to ` protos `
proto_paths
&[String]
protos
&mut Vec<PathBuf>
proto_paths
&[String]
protos
&mut Vec<PathBuf>