From 05245b0c330c037ef2f9fd2a8098ddea8872ac31 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Mon, 29 Jul 2024 13:34:50 -0700 Subject: [PATCH] Fix clippy warnings (#58) --- src/app.rs | 4 ++-- src/archive_data.rs | 2 +- src/main.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index dd83080..eca9c64 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1202,7 +1202,7 @@ impl SearchState { // Invalidate when the search query changes. if self.query != self.last_query { invalidate = true; - self.last_query = self.query.clone(); + self.last_query.clone_from(&self.query); } // Invalidate when the search field changes. @@ -2002,7 +2002,7 @@ impl ProfApp { } fn multiply_scale_factor(cx: &mut Context, factor: f32) { - cx.scale_factor = (cx.scale_factor * factor).min(4.0).max(0.25); + cx.scale_factor = (cx.scale_factor * factor).clamp(0.25, 4.0); } fn reset_scale_factor(cx: &mut Context) { diff --git a/src/archive_data.rs b/src/archive_data.rs index 8e40223..f489c50 100644 --- a/src/archive_data.rs +++ b/src/archive_data.rs @@ -33,7 +33,7 @@ fn create_unique_dir>(path: P, force: bool) -> io::Result= retry_limit { // tried too many times, assume this is a permanent failure diff --git a/src/main.rs b/src/main.rs index ae8172e..0283ae2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -214,7 +214,7 @@ impl RandomDataSource { } fn entry_info(rng: &mut rand::rngs::ThreadRng) -> EntryInfo { - let kinds = vec![ + let kinds = [ "CPU".to_string(), "GPU".to_string(), "OMP".to_string(),