feat(core): add easy constructors for Ordering
This commit is contained in:
parent
f8ec8857d4
commit
4f470eae50
1 changed files with 26 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue