1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use std::cmp::Ordering;
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub(crate) enum SqlCompareResult {
Eq,
LessThan,
GreaterThan,
Null,
}
impl From<Ordering> for SqlCompareResult {
fn from(ord: Ordering) -> Self {
match ord {
Ordering::Less => Self::LessThan,
Ordering::Equal => Self::Eq,
Ordering::Greater => Self::GreaterThan,
}
}
}
impl From<Option<Ordering>> for SqlCompareResult {
fn from(partial_ord: Option<Ordering>) -> Self {
match partial_ord {
Some(Ordering::Less) => Self::LessThan,
Some(Ordering::Equal) => Self::Eq,
Some(Ordering::Greater) => Self::GreaterThan,
None => Self::Null,
}
}
}