diff options
Diffstat (limited to 'crates/shirabe-semver/src/constraint/any_constraint.rs')
| -rw-r--r-- | crates/shirabe-semver/src/constraint/any_constraint.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/shirabe-semver/src/constraint/any_constraint.rs b/crates/shirabe-semver/src/constraint/any_constraint.rs index 37541deb..33c2f7d0 100644 --- a/crates/shirabe-semver/src/constraint/any_constraint.rs +++ b/crates/shirabe-semver/src/constraint/any_constraint.rs @@ -5,6 +5,7 @@ use crate::constraint::MatchAllConstraint; use crate::constraint::MatchNoneConstraint; use crate::constraint::MultiConstraint; use crate::constraint::SimpleConstraint; +use shirabe_php_shim::CmpOp; /// Corresponds to PHP's `ConstraintInterface`. #[derive(Clone, Debug)] @@ -36,7 +37,7 @@ impl AnyConstraint { } } - pub fn compile(&self, other_operator: i64) -> String { + pub fn compile(&self, other_operator: CmpOp) -> String { match self { Self::Simple(c) => c.compile(other_operator), Self::Multi(c) => c.compile(other_operator), @@ -82,10 +83,10 @@ impl AnyConstraint { matches!(self, Self::Simple(_)) } - pub fn get_operator(&self) -> &'static str { + pub fn get_operator(&self) -> Option<CmpOp> { match self { - Self::Simple(c) => c.get_operator(), - _ => "", + Self::Simple(c) => Some(c.get_operator()), + _ => None, } } |
