Skip to content

Commit fc59b36

Browse files
Fix Source/Fn/Binary/Command/Parallel.rs: GlobSet and Group usage
1 parent 592b6ce commit fc59b36

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Source/Fn/Binary/Command/Parallel.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ pub async fn Fn(Option { Entry, Separator, Pattern, .. }:Option) {
4343

4444
let Queue = futures::stream::FuturesUnordered::new();
4545

46+
let glob = globset::Glob::new(&Pattern)
47+
.expect("Invalid pattern")
48+
.compile_matcher();
49+
4650
for Entry in Entry
4751
.into_par_iter()
4852
.filter_map(|Entry| {
49-
if globset::GlobSet.is_match(&Entry.join(&Separator.to_string())) {
53+
if glob.is_match(&Entry.join(&Separator.to_string())) {
5054
Some(Entry[0..Entry.len() - 1].join(&Separator.to_string()))
5155
} else {
5256
None
@@ -59,7 +63,7 @@ pub async fn Fn(Option { Entry, Separator, Pattern, .. }:Option) {
5963
Queue.push(tokio::spawn(async move {
6064
match crate::Fn::Build::Fn(&Entry).await {
6165
Ok(Build) => {
62-
if let Err(_Error) = Allow.send((Entry, Build)) {
66+
if let Err(_Error) = Allow.send((Entry, format!("{:?}", Build))) {
6367
eprintln!("Cannot Allow: {}", _Error);
6468
}
6569
},

0 commit comments

Comments
 (0)