Skip to content

Commit 0716b88

Browse files
committed
move code out of loop
1 parent 3cf5cc3 commit 0716b88

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/cargo/core/resolver/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -960,13 +960,6 @@ fn find_candidate(
960960
};
961961

962962
while let Some(mut frame) = backtrack_stack.pop() {
963-
let next = frame
964-
.remaining_candidates
965-
.next(&mut frame.conflicting_activations, &frame.context);
966-
let Some((candidate, has_another)) = next else {
967-
panic!("why did we save a frame that has no next?");
968-
};
969-
970963
// If all members of `conflicting_activations` are still
971964
// active in this back up we know that we're guaranteed to not actually
972965
// make any progress. As a result if we hit this condition we can
@@ -999,6 +992,11 @@ fn find_candidate(
999992
}
1000993
}
1001994

995+
let (candidate, has_another) = frame
996+
.remaining_candidates
997+
.next(&mut frame.conflicting_activations, &frame.context)
998+
.expect("why did we save a frame that has no next?");
999+
10021000
return Some((candidate, has_another, frame));
10031001
}
10041002
None

0 commit comments

Comments
 (0)