From b370e746a09a08380cd70488d65781f03eb8b723 Mon Sep 17 00:00:00 2001 From: houseme Date: Mon, 7 Sep 2026 18:12:00 +0800 Subject: [PATCH] fix(io-metrics): simplify early eviction check (#7383) Replace a needless bool return with the equivalent predicate so clippy can pass with warnings denied. Co-authored-by: zhi22915 --- crates/io-metrics/src/cache_config.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/io-metrics/src/cache_config.rs b/crates/io-metrics/src/cache_config.rs index cbe61bf5b..c2de3de1a 100644 --- a/crates/io-metrics/src/cache_config.rs +++ b/crates/io-metrics/src/cache_config.rs @@ -241,10 +241,7 @@ impl AdaptiveTTL { // 1. Item is cold (low access count) // 2. Age is significant (> 50% of TTL) // 3. No recent accesses - if access_count <= self.cold_threshold && age > current_ttl / 2 { - return true; - } - false + access_count <= self.cold_threshold && age > current_ttl / 2 } /// Calculate priority score for an item.