Skip to content

Commit 3807440

Browse files
committed
avoid early return to handle all paths
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent be2f75f commit 3807440

File tree

1 file changed

+3
-2
lines changed
  • src/bootstrap/src/core/builder

1 file changed

+3
-2
lines changed

src/bootstrap/src/core/builder/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,15 @@ impl PathSet {
273273
/// See `tests.rs` for examples.
274274
fn intersection_removing_matches(&self, needles: &mut [CLIStepPath], module: Kind) -> PathSet {
275275
let mut check = |p| {
276+
let mut result = false;
276277
for n in needles.iter_mut() {
277278
let matched = Self::check(p, &n.path, module);
278279
if matched {
279280
n.will_be_executed = true;
280-
return true;
281+
result = true;
281282
}
282283
}
283-
false
284+
result
284285
};
285286
match self {
286287
PathSet::Set(set) => PathSet::Set(set.iter().filter(|&p| check(p)).cloned().collect()),

0 commit comments

Comments
 (0)