feat(core): add easy constructors for Ordering

This commit is contained in:
Anand Balakrishnan 2023-04-05 13:28:47 -07:00
parent f8ec8857d4
commit 4f470eae50
No known key found for this signature in database

View file

@ -69,6 +69,32 @@ pub enum Ordering {
Greater { strict: bool },
}
impl Ordering {
pub fn equal() -> Self {
Self::Eq
}
pub fn not_equal() -> Self {
Self::NotEq
}
pub fn less_than() -> Self {
Self::Less { strict: true }
}
pub fn less_than_eq() -> Self {
Self::Less { strict: false }
}
pub fn greater_than() -> Self {
Self::Greater { strict: true }
}
pub fn greater_than_eq() -> Self {
Self::Greater { strict: false }
}
}
/// All expressions that are evaluated to be of type `bool`
#[derive(Clone, Debug, PartialEq)]
pub enum BoolExpr {