aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/dependency_resolver')
-rw-r--r--crates/shirabe/src/dependency_resolver/pool.rs10
-rw-r--r--crates/shirabe/src/dependency_resolver/security_advisory_pool_filter.rs8
2 files changed, 11 insertions, 7 deletions
diff --git a/crates/shirabe/src/dependency_resolver/pool.rs b/crates/shirabe/src/dependency_resolver/pool.rs
index adf42f54..a9dffe71 100644
--- a/crates/shirabe/src/dependency_resolver/pool.rs
+++ b/crates/shirabe/src/dependency_resolver/pool.rs
@@ -28,7 +28,8 @@ pub struct Pool {
/// @var array<string, array<string, string>> Map of package object hash => removed normalized versions => removed pretty version
pub(crate) removed_versions_by_package: IndexMap<String, IndexMap<String, String>>,
/// @var array<string, array<string, array<SecurityAdvisory|PartialSecurityAdvisory>>> Map of package name => normalized version => security advisories
- security_removed_versions: IndexMap<String, IndexMap<String, Vec<AnySecurityAdvisory>>>,
+ security_removed_versions:
+ IndexMap<String, IndexMap<String, Vec<std::rc::Rc<AnySecurityAdvisory>>>>,
/// @var array<string, array<string, string>> Map of package name => normalized version => pretty version
abandoned_removed_versions: IndexMap<String, IndexMap<String, String>>,
}
@@ -45,7 +46,10 @@ impl Pool {
unacceptable_fixed_or_locked_packages: Vec<BasePackageHandle>,
removed_versions: IndexMap<String, IndexMap<String, String>>,
removed_versions_by_package: IndexMap<String, IndexMap<String, String>>,
- security_removed_versions: IndexMap<String, IndexMap<String, Vec<AnySecurityAdvisory>>>,
+ security_removed_versions: IndexMap<
+ String,
+ IndexMap<String, Vec<std::rc::Rc<AnySecurityAdvisory>>>,
+ >,
abandoned_removed_versions: IndexMap<String, IndexMap<String, String>>,
) -> Self {
let mut this = Self {
@@ -182,7 +186,7 @@ impl Pool {
/// @return array<string, array<string, array<SecurityAdvisory|PartialSecurityAdvisory>>>
pub fn get_all_security_removed_package_versions(
&self,
- ) -> &IndexMap<String, IndexMap<String, Vec<AnySecurityAdvisory>>> {
+ ) -> &IndexMap<String, IndexMap<String, Vec<std::rc::Rc<AnySecurityAdvisory>>>> {
&self.security_removed_versions
}
diff --git a/crates/shirabe/src/dependency_resolver/security_advisory_pool_filter.rs b/crates/shirabe/src/dependency_resolver/security_advisory_pool_filter.rs
index 59acad89..c2b95bd7 100644
--- a/crates/shirabe/src/dependency_resolver/security_advisory_pool_filter.rs
+++ b/crates/shirabe/src/dependency_resolver/security_advisory_pool_filter.rs
@@ -87,7 +87,7 @@ impl SecurityAdvisoryPoolFilter {
let mut packages: Vec<BasePackageHandle> = vec![];
let mut security_removed_versions: IndexMap<
String,
- IndexMap<String, Vec<AnySecurityAdvisory>>,
+ IndexMap<String, Vec<std::rc::Rc<AnySecurityAdvisory>>>,
> = IndexMap::new();
let mut abandoned_removed_versions: IndexMap<String, IndexMap<String, String>> =
IndexMap::new();
@@ -144,13 +144,13 @@ impl SecurityAdvisoryPoolFilter {
fn get_matching_advisories(
&self,
package: BasePackageHandle,
- advisory_map: &IndexMap<String, Vec<AnySecurityAdvisory>>,
- ) -> Vec<AnySecurityAdvisory> {
+ advisory_map: &IndexMap<String, Vec<std::rc::Rc<AnySecurityAdvisory>>>,
+ ) -> Vec<std::rc::Rc<AnySecurityAdvisory>> {
if package.is_dev() {
return vec![];
}
- let mut matching_advisories: Vec<AnySecurityAdvisory> = vec![];
+ let mut matching_advisories = vec![];
for package_name in package.get_names(false) {
if !advisory_map.contains_key(&package_name) {
continue;