From 2cf8ae7817db0a74b744f41484db81e1c441ebf3 Mon Sep 17 00:00:00 2001 From: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com> Date: Thu, 13 Jul 2023 23:22:52 +0530 Subject: [PATCH] chore: address Rust 1.71 clippy lints (#1708) --- crates/router/src/db/api_keys.rs | 2 +- crates/router/src/db/dispute.rs | 2 +- crates/router/src/db/events.rs | 2 +- crates/router/tests/connectors/selenium.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/router/src/db/api_keys.rs b/crates/router/src/db/api_keys.rs index 70e2cb99f9..512664f517 100644 --- a/crates/router/src/db/api_keys.rs +++ b/crates/router/src/db/api_keys.rs @@ -246,7 +246,7 @@ impl ApiKeyInterface for MockDb { ) -> CustomResult { let mut locked_api_keys = self.api_keys.lock().await; // find a key with the given merchant_id and key_id and update, otherwise return an error - let mut key_to_update = locked_api_keys + let key_to_update = locked_api_keys .iter_mut() .find(|k| k.merchant_id == merchant_id && k.key_id == key_id) .ok_or(errors::StorageError::MockDbError)?; diff --git a/crates/router/src/db/dispute.rs b/crates/router/src/db/dispute.rs index 17265fe06b..43bbbadd1e 100644 --- a/crates/router/src/db/dispute.rs +++ b/crates/router/src/db/dispute.rs @@ -300,7 +300,7 @@ impl DisputeInterface for MockDb { ) -> CustomResult { let mut locked_disputes = self.disputes.lock().await; - let mut dispute_to_update = locked_disputes + let dispute_to_update = locked_disputes .iter_mut() .find(|d| d.dispute_id == this.dispute_id) .ok_or(errors::StorageError::MockDbError)?; diff --git a/crates/router/src/db/events.rs b/crates/router/src/db/events.rs index 148fd6a037..5e2a4310ea 100644 --- a/crates/router/src/db/events.rs +++ b/crates/router/src/db/events.rs @@ -74,7 +74,7 @@ impl EventInterface for MockDb { event: storage::EventUpdate, ) -> CustomResult { let mut locked_events = self.events.lock().await; - let mut event_to_update = locked_events + let event_to_update = locked_events .iter_mut() .find(|e| e.event_id == event_id) .ok_or(errors::StorageError::MockDbError)?; diff --git a/crates/router/tests/connectors/selenium.rs b/crates/router/tests/connectors/selenium.rs index 36b2fff08b..b49575a94b 100644 --- a/crates/router/tests/connectors/selenium.rs +++ b/crates/router/tests/connectors/selenium.rs @@ -311,7 +311,7 @@ pub trait SeleniumTest { Trigger::SwitchTab(position) => match position { Position::Next => { let windows = driver.windows().await?; - if let Some(window) = windows.iter().rev().next() { + if let Some(window) = windows.iter().next_back() { driver.switch_to_window(window.to_owned()).await?; } }