Skip to content

Commit b9783b4

Browse files
yaahcm-ou-se
andauthored
Update tools/agenda-generator/src/generator.rs
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
1 parent 2274da1 commit b9783b4

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

tools/agenda-generator/src/generator.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -509,20 +509,12 @@ impl GithubQuery {
509509
let issues = github_api(&endpoint)?;
510510
let issues = generator.dedup(issues);
511511

512-
let excluded_labels: BTreeSet<_> = self
513-
.excluded_labels
514-
.iter()
515-
.flat_map(|labels| labels.iter())
516-
.map(|s| s.to_string())
517-
.collect();
518512
let issues = issues.filter(|issue| {
519-
for excluded_label in &excluded_labels {
520-
if issue.labels.contains(&excluded_label) {
521-
return false;
522-
}
523-
}
524-
525-
true
513+
!self.excluded_labels.iter().any(|labels| {
514+
labels
515+
.iter()
516+
.all(|&label| issue.labels.iter().any(|x| x == label))
517+
})
526518
});
527519

528520
let issues: Vec<_> = if let Some(count) = self.count {

0 commit comments

Comments
 (0)