From e05781b230d7766e0e50b62f87f7f1c7c3a742f4 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sat, 11 Jan 2025 21:33:05 +0800 Subject: [PATCH] Fix a Clippy warning (Rust 1.85 beta) clippy 0.1.85 (e30eefff41 2025-01-08) --- src/common/frequency_sketch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/frequency_sketch.rs b/src/common/frequency_sketch.rs index c518b167..fb334aea 100644 --- a/src/common/frequency_sketch.rs +++ b/src/common/frequency_sketch.rs @@ -120,7 +120,8 @@ impl FrequencySketch { let mut frequency = u8::MAX; for i in 0..4 { let index = self.index_of(hash, i); - let count = (self.table[index] >> ((start + i) << 2) & 0xF) as u8; + let shift = (start + i) << 2; + let count = ((self.table[index] >> shift) & 0xF) as u8; frequency = frequency.min(count); } frequency