diff --git a/meilisearch-http/src/analytics.rs b/meilisearch-http/src/analytics.rs index b75fb7e94..a042a5e92 100644 --- a/meilisearch-http/src/analytics.rs +++ b/meilisearch-http/src/analytics.rs @@ -552,7 +552,7 @@ pub struct MockAnalytics { impl MockAnalytics { pub fn new(opt: &Opt) -> &'static Self { - let user = find_user_id(&opt.db_path).unwrap_or(String::new()); + let user = find_user_id(&opt.db_path).unwrap_or_default(); let analytics = Box::new(Self { user }); Box::leak(analytics) } diff --git a/meilisearch-http/src/main.rs b/meilisearch-http/src/main.rs index 60535966d..85166ebe2 100644 --- a/meilisearch-http/src/main.rs +++ b/meilisearch-http/src/main.rs @@ -128,7 +128,7 @@ Anonymous telemetry: \"Enabled\"" } let analytics = analytics.to_string(); - if analytics != "" { + if !analytics.is_empty() { eprintln!("Unique User ID:\t\"{}\"", analytics); } diff --git a/meilisearch-http/src/routes/indexes/settings.rs b/meilisearch-http/src/routes/indexes/settings.rs index f70eb1222..caf78d3fc 100644 --- a/meilisearch-http/src/routes/indexes/settings.rs +++ b/meilisearch-http/src/routes/indexes/settings.rs @@ -102,7 +102,7 @@ make_setting_route!( "total": setting.as_ref().map(|filter| filter.len()), "has_geo": setting.as_ref().map(|filter| filter.contains("_geo")).unwrap_or(false), }), - Some(&req), + Some(req), ); } ); @@ -122,7 +122,7 @@ make_setting_route!( "total": setting.as_ref().map(|sort| sort.len()), "has_geo": setting.as_ref().map(|sort| sort.contains("_geo")).unwrap_or(false), }), - Some(&req), + Some(req), ); } ); @@ -174,9 +174,9 @@ make_setting_route!( analytics.publish( "RankingRules Updated".to_string(), json!({ - "sort_position": setting.as_ref().map(|sort| sort.iter().filter(|s| s.contains(":")).count()), + "sort_position": setting.as_ref().map(|sort| sort.iter().filter(|s| s.contains(':')).count()), }), - Some(&req), + Some(req), ); } ); @@ -218,7 +218,7 @@ pub async fn update_all( "Settings Updated".to_string(), json!({ "ranking_rules": { - "sort_position": settings.ranking_rules.as_ref().set().map(|sort| sort.iter().filter(|s| s.contains(":")).count()), + "sort_position": settings.ranking_rules.as_ref().set().map(|sort| sort.iter().filter(|s| s.contains(':')).count()), }, "sortable_attributes": { "total": settings.sortable_attributes.as_ref().set().map(|sort| sort.len()), diff --git a/meilisearch-http/src/routes/indexes/updates.rs b/meilisearch-http/src/routes/indexes/updates.rs index 2923736b7..dc99ef55a 100644 --- a/meilisearch-http/src/routes/indexes/updates.rs +++ b/meilisearch-http/src/routes/indexes/updates.rs @@ -13,12 +13,14 @@ pub fn configure(cfg: &mut web::ServiceConfig) { .service(web::resource("{update_id}").route(web::get().to(get_update_status))); } +/* #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] struct UpdateIndexRequest { uid: Option, primary_key: Option, } +*/ #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")]