Issue:
Bug: chore: address Rust 1.87.0 clippy lints



Address the clippy lints occurring due to new rust version 1.87.0

See https://github.com/juspay/hyperswitch/issues/3391 for more information.

Pull request description:
## Type of Change


- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description

<!-- Describe your changes in detail -->
This PR addresses the clippy lints occurring due to new rust version 1.87.0
https://rust-lang.github.io/rust-clippy/master/index.html

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
CI checks should pass as this PR addresses clippy lints.
1. ran `rustc --version`
<img width="381" alt="Screenshot 2025-05-24 at 5 18 56 AM" src="https://github.com/user-attachments/assets/dfb59d28-3085-4e96-b3b9-2bd635086356" />

3. ran `just clippy` with new rust version (1.87.0)
<img width="1004" alt="Screenshot 2025-04-07 at 5 46 05 PM" src="https://github.com/user-attachments/assets/5951c74e-8f3d-44e2-8172-e376c01c2e9d" />

4. ran `just clippy_v2` with new rust version (1.87.0)
<img width="948" alt="Screenshot 2025-05-24 at 5 19 50 AM" src="https://github.com/user-attachments/assets/a04d74c4-a1e0-48b1-8f93-09b70cde32c2" />


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Testing:

CI checks should pass as this PR addresses clippy lints.
1. ran `rustc --version`
<img width="381" alt="Screenshot 2025-05-24 at 5 18 56 AM" src="https://github.com/user-attachments/assets/dfb59d28-3085-4e96-b3b9-2bd635086356" />

3. ran `just clippy` with new rust version (1.87.0)
<img width="1004" alt="Screenshot 2025-04-07 at 5 46 05 PM" src="https://github.com/user-attachments/assets/5951c74e-8f3d-44e2-8172-e376c01c2e9d" />

4. ran `just clippy_v2` with new rust version (1.87.0)
<img width="948" alt="Screenshot 2025-05-24 at 5 19 50 AM" src="https://github.com/user-attachments/assets/a04d74c4-a1e0-48b1-8f93-09b70cde32c2" />

Patch:
diff --git a/crates/external_services/src/email/ses.rs b/crates/external_services/src/email/ses.rs
index f8e941b57b5..bc813b7d644 100644
--- a/crates/external_services/src/email/ses.rs
+++ b/crates/external_services/src/email/ses.rs
@@ -54,7 +54,7 @@ impl SESConfig {
 pub enum AwsSesError {
     /// An error occurred in the SDK while sending email.
     #[error("Failed to Send Email {0:?}")]
-    SendingFailure(aws_sdk_sesv2::error::SdkError<SendEmailError>),
+    SendingFailure(Box<aws_sdk_sesv2::error::SdkError<SendEmailError>>),
 
     /// Configuration variable is missing to construct the email client
     #[error("Missing configuration variable {0}")]
@@ -245,7 +245,7 @@ impl EmailClient for AwsSes {
             )
             .send()
             .await
-            .map_err(AwsSesError::SendingFailure)
+            .map_err(|e| AwsSesError::SendingFailure(Box::new(e)))
             .change_context(EmailError::EmailSendingFailure)?;
 
         Ok(())
diff --git a/crates/kgraph_utils/src/error.rs b/crates/kgraph_utils/src/error.rs
index 017b53ec0c0..2363e08c492 100644
--- a/crates/kgraph_utils/src/error.rs
+++ b/crates/kgraph_utils/src/error.rs
@@ -14,7 +14,7 @@ pub enum KgraphError {
     #[error("There was an error constructing the graph: {0}")]
     GraphConstructionError(hyperswitch_constraint_graph::GraphError<dir::DirValue>),
     #[error("There was an error constructing the context")]
-    ContextConstructionError(AnalysisErrorType),
+    ContextConstructionError(Box<AnalysisErrorType>),
     #[error("there was an unprecedented indexing error")]
     IndexingError,
 }
diff --git a/crates/kgraph_utils/src/transformers.rs b/crates/kgraph_utils/src/transformers.rs
index 1b5d3392aa2..d9e16773a2c 100644
--- a/crates/kgraph_utils/src/transformers.rs
+++ b/crates/kgraph_utils/src/transformers.rs
@@ -167,7 +167,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
                 | api_enums::PaymentMethod::Voucher
                 | api_enums::PaymentMethod::OpenBanking
                 | api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError(
-                    AnalysisErrorType::NotSupported,
+                    Box::new(AnalysisErrorType::NotSupported),
                 )),
             },
             api_enums::PaymentMethodType::Bacs => match self.1 {
@@ -186,7 +186,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
                 | api_enums::PaymentMethod::Voucher
                 | api_enums::PaymentMethod::OpenBanking
                 | api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError(
-                    AnalysisErrorType::NotSupported,
+                    Box::new(AnalysisErrorType::NotSupported),
                 )),
             },
             api_enums::PaymentMethodType::Becs => Ok(dirval!(BankDebitType = Becs)),
diff --git a/crates/masking/src/serde.rs b/crates/masking/src/serde.rs
index 48514df8c6c..ecb92086a63 100644
--- a/crates/masking/src/serde.rs
+++ b/crates/masking/src/serde.rs
@@ -15,7 +15,6 @@ use crate::{Secret, Strategy, StrongSecret, ZeroizableSecret};
 ///
 /// This is done deliberately to prevent accidental exfiltration of secrets
 /// via `serde` serialization.
-
 #[cfg_attr(docsrs, cfg(feature = "serde"))]
 pub trait SerializableSecret: Serialize {}
 // #[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
diff --git a/crates/router/src/bin/router.rs b/crates/router/src/bin/router.rs
index 212a1257425..0fb415bdd4a 100644
--- a/crates/router/src/bin/router.rs
+++ b/crates/router/src/bin/router.rs
@@ -45,6 +45,6 @@ async fn main() -> ApplicationResult<()> {
     let _ = server.await;
 
     Err(error_stack::Report::from(ApplicationError::from(
-        std::io::Error::new(std::io::ErrorKind::Other, "Server shut down"),
+        std::io::Error::other("Server shut down"),
     )))
 }
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index c3c6352152b..220a48cd1e1 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -2008,9 +2008,11 @@ pub fn decide_payment_method_retrieval_action(
         )
     };
 
-    should_retry_with_pan
-        .then_some(VaultFetchAction::FetchCardDetailsFromLocker)
-        .unwrap_or_else(standard_flow)
+    if should_retry_with_pan {
+        VaultFetchAction::FetchCardDetailsFromLocker
+    } else {
+        standard_flow()
+    }
 }
 
 pub fn determine_standard_vault_action(