From b99246b7fe2643c395b344ded373d91cff118b50 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 22:00:40 +0000 Subject: [PATCH] fix(ops): hash diagnostic keys without DefaultHasher::new Replace DefaultHasher in diagnostic_key with a simple byte fold to satisfy DeepSource RS-W1079 (avoid DefaultHasher::new for non-crypto hashing). Co-authored-by: Cursor --- src/daemon.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/daemon.rs b/src/daemon.rs index 8179989..078850b 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -799,11 +799,9 @@ impl OccurrenceLimiter { } fn diagnostic_key(message: &str) -> u64 { - use std::collections::hash_map::DefaultHasher; - use std::hash::{Hash, Hasher}; - let mut hasher = DefaultHasher::new(); - message.hash(&mut hasher); - hasher.finish() + message.bytes().fold(0u64, |hash, byte| { + hash.wrapping_mul(31).wrapping_add(u64::from(byte)) + }) } #[derive(Debug)]