aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/advisory_provider_interface.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-23 23:14:52 +0900
committernsfisis <nsfisis@gmail.com>2026-05-23 23:15:14 +0900
commitdbdecaf5a1c54a876b7ee0153d58dd39b1080f97 (patch)
treef13f2ced03c803dcbc42a5672458b3cb19ff0f30 /crates/shirabe/src/repository/advisory_provider_interface.rs
parentf5b987a00712211b7ce56300851182bda904e97b (diff)
downloadphp-shirabe-dbdecaf5a1c54a876b7ee0153d58dd39b1080f97.tar.gz
php-shirabe-dbdecaf5a1c54a876b7ee0153d58dd39b1080f97.tar.zst
php-shirabe-dbdecaf5a1c54a876b7ee0153d58dd39b1080f97.zip
refactor(semver): change ConstraintInterface to a closed enum
Replace the dyn ConstraintInterface trait objects with an AnyConstraint enum closing over its four implementors (Simple, Multi, MatchAll, MatchNone), mirroring the earlier Rule enum conversion. Rename constraint.rs to simple_constraint.rs to match the renamed Constraint type. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/advisory_provider_interface.rs')
-rw-r--r--crates/shirabe/src/repository/advisory_provider_interface.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/src/repository/advisory_provider_interface.rs b/crates/shirabe/src/repository/advisory_provider_interface.rs
index 4c08a63..0de9c42 100644
--- a/crates/shirabe/src/repository/advisory_provider_interface.rs
+++ b/crates/shirabe/src/repository/advisory_provider_interface.rs
@@ -3,7 +3,7 @@
use crate::advisory::PartialSecurityAdvisory;
use crate::advisory::SecurityAdvisory;
use indexmap::IndexMap;
-use shirabe_semver::constraint::ConstraintInterface;
+use shirabe_semver::constraint::AnyConstraint;
#[derive(Debug)]
pub enum PartialOrSecurityAdvisory {
@@ -31,7 +31,7 @@ pub trait AdvisoryProviderInterface {
fn get_security_advisories(
&self,
- package_constraint_map: IndexMap<String, Box<dyn ConstraintInterface>>,
+ package_constraint_map: IndexMap<String, AnyConstraint>,
allow_partial_advisories: bool,
) -> anyhow::Result<SecurityAdvisoryResult>;
}