diff --git a/lib/src/dbs/iterator.rs b/lib/src/dbs/iterator.rs index b3d0cb40..b5dd8fc3 100644 --- a/lib/src/dbs/iterator.rs +++ b/lib/src/dbs/iterator.rs @@ -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), }, }; // diff --git a/lib/src/sql/order.rs b/lib/src/sql/order.rs index 9306d10b..a8aa0ed5 100644 --- a/lib/src/sql/order.rs +++ b/lib/src/sql/order.rs @@ -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)?;