From 76e2a02d47cf955ceb348e99264b9642c977fa32 Mon Sep 17 00:00:00 2001 From: Tomasz Pietrek Date: Thu, 31 Aug 2023 09:46:08 +0200 Subject: [PATCH] Fix clippy errors in nats client Signed-off-by: Tomasz Pietrek --- nats/src/jetstream/push_subscription.rs | 4 ++-- nats/src/subscription.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nats/src/jetstream/push_subscription.rs b/nats/src/jetstream/push_subscription.rs index 5b8ede2f5..9f36b6640 100644 --- a/nats/src/jetstream/push_subscription.rs +++ b/nats/src/jetstream/push_subscription.rs @@ -342,7 +342,7 @@ impl PushSubscription { self.0.stream, self.0.consumer, )) .spawn(move || { - for m in sub.iter() { + for m in &sub { if let Err(e) = handler(m) { // TODO(dlc) - Capture for last error? log::error!("Error in callback! {:?}", e); @@ -394,7 +394,7 @@ impl PushSubscription { self.0.consumer, self.0.stream )) .spawn(move || { - for message in sub.iter() { + for message in &sub { if let Err(err) = handler(&message) { log::error!("Error in callback! {:?}", err); } diff --git a/nats/src/subscription.rs b/nats/src/subscription.rs index c650fcc5d..be8bb3f32 100644 --- a/nats/src/subscription.rs +++ b/nats/src/subscription.rs @@ -246,7 +246,7 @@ impl Subscription { thread::Builder::new() .name(format!("nats_subscriber_{}_{}", self.0.sid, self.0.subject)) .spawn(move || { - for m in sub.iter() { + for m in &sub { if let Err(e) = handler(m) { // TODO(dlc) - Capture for last error? log::error!("Error in callback! {:?}", e);