mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
impl Display for v2::settings::Criterion
This commit is contained in:
parent
5d22c7bcce
commit
d44652209d
@ -1,4 +1,5 @@
|
|||||||
use std::collections::{BTreeMap, BTreeSet};
|
use std::collections::{BTreeMap, BTreeSet};
|
||||||
|
use std::fmt::Display;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
@ -174,3 +175,17 @@ impl FromStr for Criterion {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Display for Criterion {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
Criterion::Words => write!(f, "words"),
|
||||||
|
Criterion::Typo => write!(f, "typo"),
|
||||||
|
Criterion::Proximity => write!(f, "proximity"),
|
||||||
|
Criterion::Attribute => write!(f, "attribute"),
|
||||||
|
Criterion::Exactness => write!(f, "exactness"),
|
||||||
|
Criterion::Asc(field_name) => write!(f, "asc({})", field_name),
|
||||||
|
Criterion::Desc(field_name) => write!(f, "desc({})", field_name),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user