Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

chore: address Rust 1.71 clippy lints (#1708)

Sanchith Hegde2cf8ae7817db
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<storage::ApiKey, errors::StorageError> {
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<storage::Dispute, errors::StorageError> {
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<storage::Event, errors::StorageError> {
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?;
}
}