mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	makes clippy happy
This commit is contained in:
		| @@ -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) | ||||
|     } | ||||
|   | ||||
| @@ -128,7 +128,7 @@ Anonymous telemetry:   \"Enabled\"" | ||||
|     } | ||||
|  | ||||
|     let analytics = analytics.to_string(); | ||||
|     if analytics != "" { | ||||
|     if !analytics.is_empty() { | ||||
|         eprintln!("Unique User ID:\t\"{}\"", analytics); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -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()), | ||||
|   | ||||
| @@ -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<String>, | ||||
|     primary_key: Option<String>, | ||||
| } | ||||
| */ | ||||
|  | ||||
| #[derive(Debug, Serialize)] | ||||
| #[serde(rename_all = "camelCase")] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user