From f31b405fd5e125c1c6d7965bb84d10449910e96e Mon Sep 17 00:00:00 2001 From: Will Pfleger Date: Tue, 14 Jul 2026 00:25:23 -0400 Subject: [PATCH] fix(db): use deref instead of clone on Copy type DateTime Clippy clone_on_copy: DateTime is Copy, dereference instead. --- crates/buzz-db/src/lib.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/buzz-db/src/lib.rs b/crates/buzz-db/src/lib.rs index 00aa14e91d..cba5d107cc 100644 --- a/crates/buzz-db/src/lib.rs +++ b/crates/buzz-db/src/lib.rs @@ -2939,16 +2939,15 @@ impl Db { // Stale-write protection: reject if either durable ordering source // dominates the incoming tuple. Equal timestamps use lowest event id. let incoming_id = event.id.as_bytes().as_slice(); - let existing_ordering = existing - .as_ref() - .map(|(ts, id, _)| (ts.clone(), id.clone())); - let dominated = existing_ordering - .iter() - .chain(watermark.iter()) - .any(|(accepted_ts, accepted_id)| { - created_at < *accepted_ts - || (created_at == *accepted_ts && incoming_id >= accepted_id.as_slice()) - }); + let existing_ordering = existing.as_ref().map(|(ts, id, _)| (*ts, id.clone())); + let dominated = + existing_ordering + .iter() + .chain(watermark.iter()) + .any(|(accepted_ts, accepted_id)| { + created_at < *accepted_ts + || (created_at == *accepted_ts && incoming_id >= accepted_id.as_slice()) + }); if dominated { tx.rollback().await?; let received_at = chrono::Utc::now();