From efd0ea9e1e4c94577983505f7377e08d5c788821 Mon Sep 17 00:00:00 2001 From: Tamo Date: Thu, 28 Oct 2021 13:05:58 +0200 Subject: [PATCH] makes clippy happier --- meilisearch-http/src/analytics/segment_analytics.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/meilisearch-http/src/analytics/segment_analytics.rs b/meilisearch-http/src/analytics/segment_analytics.rs index c5f8a64af..4d975dba1 100644 --- a/meilisearch-http/src/analytics/segment_analytics.rs +++ b/meilisearch-http/src/analytics/segment_analytics.rs @@ -65,7 +65,7 @@ pub struct SegmentAnalytics { impl SegmentAnalytics { fn compute_traits(opt: &Opt, stats: Stats) -> Value { static FIRST_START_TIMESTAMP: Lazy = Lazy::new(Instant::now); - const SYSTEM: Lazy = Lazy::new(|| { + static SYSTEM: Lazy = Lazy::new(|| { let mut sys = System::new_all(); sys.refresh_all(); let kernel_version = sys @@ -111,9 +111,7 @@ impl SegmentAnalytics { write_user_id(&opt.db_path, &user_id); let client = HttpClient::default(); - let user = User::UserId { - user_id: user_id.clone(), - }; + let user = User::UserId { user_id }; let batcher = Mutex::new(AutoBatcher::new( client, Batcher::new(None), @@ -215,7 +213,7 @@ impl SegmentAnalytics { // to avoid blocking the search we are going to do the heavier computation and take the // batcher's mutex in an async task tokio::spawn(async move { - const RE: Lazy = Lazy::new(|| Regex::new("AND | OR").unwrap()); + static RE: Lazy = Lazy::new(|| Regex::new("AND | OR").unwrap()); let filtered = filter.is_some() as usize; let syntax = match filter.as_ref() {