diff --git a/crates/meilisearch/src/routes/indexes/settings.rs b/crates/meilisearch/src/routes/indexes/settings.rs index e47208264..3b1db5758 100644 --- a/crates/meilisearch/src/routes/indexes/settings.rs +++ b/crates/meilisearch/src/routes/indexes/settings.rs @@ -25,23 +25,10 @@ use crate::Opt; /// It also generates a `configure` function that configures the routes for the settings. macro_rules! make_setting_routes { ($({route: $route:literal, update_verb: $update_verb:ident, value_type: $type:ty, err_type: $err_ty:ty, attr: $attr:ident, camelcase_attr: $camelcase_attr:literal, analytics: $analytics:ident},)*) => { - #[allow(dead_code)] - const _: () = { - // First, verify that all fields in Settings are listed in the macro - const fn __verify_settings_exist() { - // This pattern match will fail at compile time if any field is missing from the macro - // or if a field exists in the macro but not in Settings - let _: fn(meilisearch_types::settings::Settings) = |s| { - match s { - meilisearch_types::settings::Settings { - $($attr: _,)* - _kind: _, - } => {} - } - }; - - // if any field is missing or has the wrong type - let _: fn(meilisearch_types::settings::Settings) = |_| {}; + const _: fn(&meilisearch_types::settings::Settings) = |s| { + // This pattern match will fail at compile time if any field in Settings is not listed in the macro + match *s { + meilisearch_types::settings::Settings { $($attr: _,)* _kind: _ } => {} } };