diff --git a/meilisearch/src/search/federated.rs b/meilisearch/src/search/federated.rs index a656f5538..6d445eb67 100644 --- a/meilisearch/src/search/federated.rs +++ b/meilisearch/src/search/federated.rs @@ -27,7 +27,7 @@ use super::{ use crate::error::MeilisearchHttpError; use crate::routes::indexes::search::search_kind; -pub const DEFAULT_FEDERATED_WEIGHT: fn() -> f64 = || 1.0; +pub const DEFAULT_FEDERATED_WEIGHT: f64 = 1.0; #[derive(Debug, Default, Clone, Copy, PartialEq, deserr::Deserr)] #[deserr(error = DeserrJsonError, rename_all = camelCase, deny_unknown_fields)] @@ -42,7 +42,7 @@ pub struct Weight(f64); impl Default for Weight { fn default() -> Self { - Weight(DEFAULT_FEDERATED_WEIGHT()) + Weight(DEFAULT_FEDERATED_WEIGHT) } } @@ -50,8 +50,6 @@ impl std::convert::TryFrom for Weight { type Error = InvalidMultiSearchWeight; fn try_from(f: f64) -> Result { - // the suggested "fix" is: `!(0.0..=1.0).contains(&f)`` which is allegedly less readable - #[allow(clippy::manual_range_contains)] if f < 0.0 { Err(InvalidMultiSearchWeight) } else { diff --git a/meilisearch/src/search/ranking_rules.rs b/meilisearch/src/search/ranking_rules.rs index d31c0ed35..7d7d3a1f7 100644 --- a/meilisearch/src/search/ranking_rules.rs +++ b/meilisearch/src/search/ranking_rules.rs @@ -125,7 +125,7 @@ impl CompatibilityError { | (RankingRuleKind::Relevancy, RankingRuleKind::DescendingGeoSort) | (RankingRuleKind::AscendingGeoSort, RankingRuleKind::Relevancy) | (RankingRuleKind::DescendingGeoSort, RankingRuleKind::Relevancy) => { - "cannot compare a relevancy rule with a sort rule" + "cannot compare a relevancy rule with a geosort rule" } (RankingRuleKind::AscendingSort, RankingRuleKind::DescendingSort)