From 7688d678709c8da6e6b5466b7f658bb51fcc0db5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 9 Jun 2024 06:50:44 +0000 Subject: [PATCH] Fix needless pass by ref mut Signed-off-by: Jason Volk --- Cargo.toml | 1 - src/service/sending/sender.rs | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f52b9c8f..3633bc1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -718,7 +718,6 @@ nursery = "warn" future_not_send = { level = "allow", priority = 1 } # TODO missing_const_for_fn = { level = "allow", priority = 1 } # TODO needless_collect = { level = "allow", priority = 1 } # TODO -needless_pass_by_ref_mut = { level = "allow", priority = 1 } # TODO option_if_let_else = { level = "allow", priority = 1 } # TODO redundant_pub_crate = { level = "allow", priority = 1 } # TODO significant_drop_in_scrutinee = { level = "allow", priority = 1 } # TODO diff --git a/src/service/sending/sender.rs b/src/service/sending/sender.rs index 39b7b600..7efe3c72 100644 --- a/src/service/sending/sender.rs +++ b/src/service/sending/sender.rs @@ -60,12 +60,12 @@ impl Service { let mut futures: SendingFutures<'_> = FuturesUnordered::new(); let mut statuses: CurTransactionStatus = CurTransactionStatus::new(); - self.initial_transactions(&mut futures, &mut statuses); + self.initial_transactions(&futures, &mut statuses); loop { debug_assert!(!receiver.is_closed(), "channel error"); tokio::select! { request = receiver.recv_async() => match request { - Ok(request) => self.handle_request(request, &mut futures, &mut statuses), + Ok(request) => self.handle_request(request, &futures, &mut statuses), Err(_) => return Ok(()), }, Some(response) = futures.next() => { @@ -98,7 +98,7 @@ impl Service { } fn handle_response_ok( - &self, dest: &Destination, futures: &mut SendingFutures<'_>, statuses: &mut CurTransactionStatus, + &self, dest: &Destination, futures: &SendingFutures<'_>, statuses: &mut CurTransactionStatus, ) { let _cork = services().globals.db.cork(); self.db @@ -125,7 +125,7 @@ impl Service { } } - fn handle_request(&self, msg: Msg, futures: &mut SendingFutures<'_>, statuses: &mut CurTransactionStatus) { + fn handle_request(&self, msg: Msg, futures: &SendingFutures<'_>, statuses: &mut CurTransactionStatus) { let iv = vec![(msg.event, msg.queue_id)]; if let Ok(Some(events)) = self.select_events(&msg.dest, iv, statuses) { if !events.is_empty() { @@ -136,7 +136,7 @@ impl Service { } } - fn initial_transactions(&self, futures: &mut SendingFutures<'_>, statuses: &mut CurTransactionStatus) { + fn initial_transactions(&self, futures: &SendingFutures<'_>, statuses: &mut CurTransactionStatus) { let keep = usize::try_from(self.startup_netburst_keep).unwrap_or(usize::MAX); let mut txns = HashMap::>::new(); for (key, dest, event) in self.db.active_requests().filter_map(Result::ok) {