Implement Deref on SQL Order type
This commit is contained in:
parent
89f731c903
commit
0125cb28b0
2 changed files with 9 additions and 2 deletions
|
@ -295,8 +295,8 @@ impl Iterator {
|
|||
a.partial_cmp(&b)
|
||||
}
|
||||
false => match order.direction {
|
||||
true => a.compare(b, &order.order, order.collate, order.numeric),
|
||||
false => b.compare(a, &order.order, order.collate, order.numeric),
|
||||
true => a.compare(b, order, order.collate, order.numeric),
|
||||
false => b.compare(a, order, order.collate, order.numeric),
|
||||
},
|
||||
};
|
||||
//
|
||||
|
|
|
@ -48,6 +48,13 @@ pub struct Order {
|
|||
pub direction: bool,
|
||||
}
|
||||
|
||||
impl Deref for Order {
|
||||
type Target = Idiom;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.order
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Order {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", self.order)?;
|
||||
|
|
Loading…
Reference in a new issue