mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-24 03:25:43 +08:00
simplified the method in the macro
This commit is contained in:
parent
262b429a4c
commit
f4ff722247
@ -18,27 +18,27 @@ use crate::routes::{get_task_id, is_dry_run, SummarizedTaskView};
|
|||||||
use crate::Opt;
|
use crate::Opt;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn verify_all_settings_fields<FH>(settings: Settings<FH>) {
|
fn verify_settings_has_routes<T>(settings: Settings<T>) {
|
||||||
match settings {
|
match settings {
|
||||||
Settings {
|
Settings {
|
||||||
filterable_attributes: _,
|
filterable_attributes: _,
|
||||||
sortable_attributes: _,
|
sortable_attributes: _,
|
||||||
displayed_attributes: _,
|
displayed_attributes: _,
|
||||||
|
localized_attributes: _,
|
||||||
searchable_attributes: _,
|
searchable_attributes: _,
|
||||||
distinct_attribute: _,
|
distinct_attribute: _,
|
||||||
proximity_precision: _,
|
proximity_precision: _,
|
||||||
typo_tolerance: _,
|
|
||||||
faceting: _,
|
|
||||||
pagination: _,
|
|
||||||
stop_words: _,
|
stop_words: _,
|
||||||
synonyms: _,
|
|
||||||
embedders: _,
|
|
||||||
ranking_rules: _,
|
|
||||||
search_cutoff_ms: _,
|
|
||||||
localized_attributes: _,
|
|
||||||
dictionary: _,
|
|
||||||
separator_tokens: _,
|
separator_tokens: _,
|
||||||
non_separator_tokens: _,
|
non_separator_tokens: _,
|
||||||
|
dictionary: _,
|
||||||
|
synonyms: _,
|
||||||
|
ranking_rules: _,
|
||||||
|
typo_tolerance: _,
|
||||||
|
pagination: _,
|
||||||
|
faceting: _,
|
||||||
|
embedders: _,
|
||||||
|
search_cutoff_ms: _,
|
||||||
..
|
..
|
||||||
} => {}
|
} => {}
|
||||||
}
|
}
|
||||||
@ -65,17 +65,11 @@ macro_rules! make_setting_route {
|
|||||||
use $crate::Opt;
|
use $crate::Opt;
|
||||||
use $crate::routes::{is_dry_run, get_task_id, SummarizedTaskView};
|
use $crate::routes::{is_dry_run, get_task_id, SummarizedTaskView};
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub struct VerifySettingExists<FH>(std::marker::PhantomData<FH>);
|
fn verify_setting_exists<FH>(settings: meilisearch_types::settings::Settings<FH>) {
|
||||||
#[allow(dead_code)]
|
match settings {
|
||||||
impl<FH> VerifySettingExists<FH> {
|
meilisearch_types::settings::Settings { $attr: _, .. } => {}
|
||||||
const VERIFY: () = {
|
}
|
||||||
match None::<Settings<FH>> {
|
|
||||||
Some(Settings { $attr: _, .. }) => (),
|
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn delete(
|
pub async fn delete(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user