From 20233c77947c123ee5102690131efef36baeec57 Mon Sep 17 00:00:00 2001 From: Matthieu Pizenberg Date: Thu, 19 Oct 2023 18:13:56 +0000 Subject: [PATCH] Rename prioritize into pick_highest_priority_pkg --- src/internal/partial_solution.rs | 5 ++++- src/solver.rs | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/internal/partial_solution.rs b/src/internal/partial_solution.rs index 8d82cb38..ebc70721 100644 --- a/src/internal/partial_solution.rs +++ b/src/internal/partial_solution.rs @@ -246,7 +246,10 @@ impl PartialSolution Priority) -> Option

{ + pub fn pick_highest_priority_pkg( + &mut self, + prioritizer: impl Fn(&P, &VS) -> Priority, + ) -> Option

{ let check_all = self.changed_this_decision_level == self.current_decision_level.0.saturating_sub(1) as usize; let current_decision_level = self.current_decision_level; diff --git a/src/solver.rs b/src/solver.rs index 07b1552d..a539220d 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -103,13 +103,13 @@ pub fn resolve( state.partial_solution ); - let Some(potential_packages) = state + let Some(highest_priority_pkg) = state .partial_solution - .prioritize(|p, r| dependency_provider.prioritize(p, r)) + .pick_highest_priority_pkg(|p, r| dependency_provider.prioritize(p, r)) else { return Ok(state.partial_solution.extract_solution()); }; - next = potential_packages; + next = highest_priority_pkg; let term_intersection = state .partial_solution