From 9352a0f7cfdd5f5fc102a25d8a93218bc3dbe462 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 13 Jun 2026 00:58:32 +0200 Subject: chore(treewide): Fix some of `clippy`'s error Just a run of `cargo clippy --fix` --- crates/turtle/src/atuin_daemon/search/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/turtle/src/atuin_daemon/search/mod.rs') diff --git a/crates/turtle/src/atuin_daemon/search/mod.rs b/crates/turtle/src/atuin_daemon/search/mod.rs index 60d923cd..04beb459 100644 --- a/crates/turtle/src/atuin_daemon/search/mod.rs +++ b/crates/turtle/src/atuin_daemon/search/mod.rs @@ -93,7 +93,7 @@ impl FrecencyData { let frequency_score = (f64::from(self.count).ln() * 20.0).min(100.0); // Apply multipliers and combine scores, then round to u32 - ((recency_score * recency_mul) + (frequency_score * frequency_mul)).round() as u32 + recency_score.mul_add(recency_mul, frequency_score * frequency_mul).round() as u32 } } @@ -261,8 +261,8 @@ type FrecencyMap = Arc, u32>>; /// although this should never happen due to precomputing the frecency map. pub(crate) struct SearchIndex { /// Map from command text to command data. - /// Using DashMap for concurrent read/write access, wrapped in Arc for sharing with scorer. - /// Keys are Arc to enable zero-copy sharing with frecency_map. + /// Using `DashMap` for concurrent read/write access, wrapped in Arc for sharing with scorer. + /// Keys are Arc to enable zero-copy sharing with `frecency_map`. commands: Arc, CommandData>>, /// Nucleo fuzzy matcher - items are command strings. nucleo: RwLock>, @@ -416,7 +416,7 @@ impl SearchIndex { .global_frecency .compute(now, recency_mul, frequency_mul); // Apply overall frecency multiplier and round to u32 - let frecency = (frecency as f64 * frecency_mul).round() as u32; + let frecency = (f64::from(frecency) * frecency_mul).round() as u32; // Arc::clone is cheap - just increments reference count frecency_map.insert(Arc::clone(entry.key()), frecency); } -- cgit v1.3.1