From 960acfce194b2fbbcbd8230e69222d8a662ea2b1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 16 Jul 2026 13:48:05 +0000 Subject: [PATCH] Fix clippy needless_borrow in ContextResourceUsage operators The operator methods take `other: &ContextResourceUsage`, so passing `&other` to `add_assign`/`sub_assign` (which already take a reference) is a double-borrow that fails `cargo clippy -- -D warnings`. Drop the `&`. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01JFbRtswu7rsHrttJFauUUb --- rust/src/logging/context.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/src/logging/context.rs b/rust/src/logging/context.rs index fb1632d718..c962596dbd 100644 --- a/rust/src/logging/context.rs +++ b/rust/src/logging/context.rs @@ -219,25 +219,25 @@ impl ContextResourceUsage { /// `self += other`; mutate in place. pyo3 returns `self` for the in-place slot. fn __iadd__(&mut self, other: &ContextResourceUsage) { - self.add_assign(&other); + self.add_assign(other); } /// `self -= other`; mutate in place. pyo3 returns `self` for the in-place slot. fn __isub__(&mut self, other: &ContextResourceUsage) { - self.sub_assign(&other); + self.sub_assign(other); } /// `self + other`, returning a new object. fn __add__(&self, other: &ContextResourceUsage) -> ContextResourceUsage { let mut res = self.clone(); - res.add_assign(&other); + res.add_assign(other); res } /// `self - other`, returning a new object. fn __sub__(&self, other: &ContextResourceUsage) -> ContextResourceUsage { let mut res = self.clone(); - res.sub_assign(&other); + res.sub_assign(other); res } }