From 1fe1cd3fe9da3f34d8529a0c4cc89fdc61af5065 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 17 May 2026 17:44:03 +0900 Subject: fix(compile): add dyn keyword to all trait object usages (E0782) Co-Authored-By: Claude Sonnet 4.6 --- crates/shirabe/src/dependency_resolver/problem.rs | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/problem.rs') diff --git a/crates/shirabe/src/dependency_resolver/problem.rs b/crates/shirabe/src/dependency_resolver/problem.rs index 50b651d..adc2f43 100644 --- a/crates/shirabe/src/dependency_resolver/problem.rs +++ b/crates/shirabe/src/dependency_resolver/problem.rs @@ -35,7 +35,7 @@ pub struct Problem { pub(crate) reason_seen: IndexMap, /// A set of reasons for the problem, each is a rule or a root require and a rule - pub(crate) reasons: IndexMap>, + pub(crate) reasons: IndexMap>>, pub(crate) section: i64, } @@ -50,13 +50,13 @@ impl Problem { } /// Add a rule as a reason - pub fn add_rule(&mut self, rule: Rule) { + pub fn add_rule(&mut self, rule: Box) { let id = spl_object_hash(&rule); self.add_reason(id, rule); } /// Retrieve all reasons for this problem - pub fn get_reasons(&self) -> &IndexMap> { + pub fn get_reasons(&self) -> &IndexMap>> { &self.reasons } @@ -67,11 +67,11 @@ impl Problem { request: &Request, pool: &Pool, is_verbose: bool, - installed_map: &IndexMap, - learned_pool: &Vec>, + installed_map: &IndexMap>, + learned_pool: &Vec>>, ) -> anyhow::Result { // TODO doesn't this entirely defeat the purpose of the problem sections? what's the point of sections? - let mut reasons: Vec = Vec::new(); + let mut reasons: Vec> = Vec::new(); for section_rules in self.reasons.values().rev() { for rule in section_rules { reasons.push(rule.clone()); @@ -132,7 +132,7 @@ impl Problem { )) } - fn get_sortable_string(&self, pool: &Pool, rule: &Rule) -> String { + fn get_sortable_string(&self, pool: &Pool, rule: &dyn Rule) -> String { match rule.get_reason() { Rule::RULE_ROOT_REQUIRE => rule.get_reason_data().as_array().unwrap()["packageName"] .as_string() @@ -170,7 +170,7 @@ impl Problem { } } - fn get_rule_priority(&self, rule: &Rule) -> i64 { + fn get_rule_priority(&self, rule: &dyn Rule) -> i64 { match rule.get_reason() { Rule::RULE_FIXED => 3, Rule::RULE_ROOT_REQUIRE => 2, @@ -188,14 +188,14 @@ impl Problem { /// @internal pub fn format_deduplicated_rules( - rules: &Vec, + rules: &Vec>, indent: &str, repository_set: &RepositorySet, request: &Request, pool: &Pool, is_verbose: bool, - installed_map: &IndexMap, - learned_pool: &Vec>, + installed_map: &IndexMap>, + learned_pool: &Vec>>, ) -> String { let mut messages: Vec = Vec::new(); let mut templates: IndexMap>> = @@ -350,7 +350,7 @@ impl Problem { } /// Store a reason descriptor but ignore duplicates - pub(crate) fn add_reason(&mut self, id: String, reason: Rule) { + pub(crate) fn add_reason(&mut self, id: String, reason: Box) { // TODO: if a rule is part of a problem description in two sections, isn't this going to remove a message // that is important to understand the issue? -- cgit v1.3.1