From 091600900fb349d605769d6f16d06dcc8691cf40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 16 Sep 2024 17:46:16 -0300 Subject: [PATCH] drivers: Use clone function over static method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/drivers/fake.rs | 10 +++++----- src/drivers/mod.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/drivers/fake.rs b/src/drivers/fake.rs index 7e744eeb..fdf56ccf 100644 --- a/src/drivers/fake.rs +++ b/src/drivers/fake.rs @@ -57,16 +57,16 @@ impl Driver for FakeSink { self.stats .write() .await - .update_input(Arc::clone(&message)) + .update_input(message.clone()) .await; self.stats .write() .await - .update_input(Arc::clone(&message)) + .update_input(message.clone()) .await; - for future in self.on_message_input.call_all(Arc::clone(&message)) { + for future in self.on_message_input.call_all(message.clone()) { if let Err(error) = future.await { debug!("Dropping message: on_message_input callback returned error: {error:?}"); continue; @@ -219,10 +219,10 @@ impl Driver for FakeSource { self.stats .write() .await - .update_output(Arc::clone(&message)) + .update_output(message.clone()) .await; - for future in self.on_message_output.call_all(Arc::clone(&message)) { + for future in self.on_message_output.call_all(message.clone()) { if let Err(error) = future.await { debug!( "Dropping message: on_message_input callback returned error: {error:?}" diff --git a/src/drivers/mod.rs b/src/drivers/mod.rs index ee0fb645..f921a0d0 100644 --- a/src/drivers/mod.rs +++ b/src/drivers/mod.rs @@ -282,10 +282,10 @@ mod tests { self.stats .write() .await - .update_input(Arc::clone(&message)) + .update_input(message.clone()) .await; - for future in self.on_message_input.call_all(Arc::clone(&message)) { + for future in self.on_message_input.call_all(message.clone()) { if let Err(error) = future.await { debug!( "Dropping message: on_message_input callback returned error: {error:?}"