1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use summa_proto::proto;

use crate::proto_traits::Wrapper;

impl From<Wrapper<proto::Order>> for tantivy::Order {
    fn from(order: Wrapper<proto::Order>) -> Self {
        match order.into_inner() {
            proto::Order::Asc => tantivy::Order::Asc,
            proto::Order::Desc => tantivy::Order::Desc,
        }
    }
}

impl From<Wrapper<proto::Order>> for tantivy::aggregation::bucket::Order {
    fn from(order: Wrapper<proto::Order>) -> Self {
        match order.into_inner() {
            proto::Order::Asc => tantivy::aggregation::bucket::Order::Asc,
            proto::Order::Desc => tantivy::aggregation::bucket::Order::Desc,
        }
    }
}