From 2a1696906344cb4da768a940bf8b1f89bbc82b47 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 22 May 2026 04:19:14 +0900 Subject: refactor: share Pool via Rc Convert Pool to Rc> so Solver, Decisions, and RuleSetGenerator share it, resolving the todo!() placeholders that blocked the dependency resolver (Phase C shared ownership). Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/shirabe/src/dependency_resolver/decisions.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/decisions.rs') diff --git a/crates/shirabe/src/dependency_resolver/decisions.rs b/crates/shirabe/src/dependency_resolver/decisions.rs index 1fdc1d3..f0842d9 100644 --- a/crates/shirabe/src/dependency_resolver/decisions.rs +++ b/crates/shirabe/src/dependency_resolver/decisions.rs @@ -8,7 +8,7 @@ use shirabe_php_shim::LogicException; use std::fmt; pub struct Decisions { - pub(crate) pool: Pool, + pub(crate) pool: std::rc::Rc>, pub(crate) decision_map: IndexMap, pub(crate) decision_queue: Vec<(i64, Box)>, iterator_cursor: Option, @@ -27,7 +27,7 @@ impl Decisions { pub const DECISION_LITERAL: usize = 0; pub const DECISION_REASON: usize = 1; - pub fn new(pool: Pool) -> Self { + pub fn new(pool: std::rc::Rc>) -> Self { Self { pool, decision_map: IndexMap::new(), @@ -187,10 +187,9 @@ impl Decisions { let previous_decision = self.decision_map.get(&package_id).copied().unwrap_or(0); if previous_decision != 0 { - let literal_string = self - .pool - .literal_to_pretty_string(literal, &IndexMap::new()); - let package = self.pool.literal_to_package(literal); + let pool = self.pool.borrow(); + let literal_string = pool.literal_to_pretty_string(literal, &IndexMap::new()); + let package = pool.literal_to_package(literal); panic!( "{}", SolverBugException::new(format!( -- cgit v1.3.1