Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: address Rust 1.85.0 clippy lints #7376

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

GauravRawat369
Copy link

@GauravRawat369 GauravRawat369 commented Feb 25, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR addresses the clippy lints occurring due to new rust version 1.85.0
https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@GauravRawat369 GauravRawat369 requested review from a team as code owners February 25, 2025 12:54
@GauravRawat369 GauravRawat369 self-assigned this Feb 25, 2025
@GauravRawat369 GauravRawat369 added the C-refactor Category: Refactor label Feb 25, 2025
@@ -197,7 +197,7 @@ impl CustomerCreateBridge for customers::CustomerRequest {
customer: &'a domain::Customer,
) -> errors::CustomerResponse<customers::CustomerResponse> {
let address = self.get_address();
let address_details = address.map(api_models::payments::AddressDetails::from);
let address_details = address;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this unnecessary assignment

@@ -1265,7 +1265,7 @@ impl CustomerUpdateBridge for customers::CustomerUpdateRequest {
customer: &'a domain::Customer,
) -> errors::CustomerResponse<customers::CustomerResponse> {
let address = self.get_address();
let address_details = address.map(api_models::payments::AddressDetails::from);
let address_details = address;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this unnecessary assignment

@@ -283,7 +283,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
payment_intent.metadata = request.metadata.clone().or(payment_intent.metadata);

// The operation merges mandate data from both request and payment_attempt
let setup_mandate = mandate_data.map(Into::into);
let setup_mandate = mandate_data;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this unnecessary assignment

Copy link
Author

@GauravRawat369 GauravRawat369 Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub struct PaymentData
where
F: Clone,
{
pub flow: PhantomData,
pub payment_intent: storage::PaymentIntent,
............................
pub setup_mandate: Option,
pub customer_acceptance: Option,
..........................,

}
setup-mandate is described in PaymentData should I change this to mandate_data?
Doing this will break other things

@@ -493,7 +493,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
.transpose()?;

// The operation merges mandate data from both request and payment_attempt
let setup_mandate = mandate_data.map(MandateData::from);
let setup_mandate = mandate_data;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this unnecessary assignment

@@ -421,7 +421,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
.transpose()?;

// The operation merges mandate data from both request and payment_attempt
let setup_mandate = mandate_data.map(Into::into);
let setup_mandate = mandate_data;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this unnecessary assignment

@@ -165,7 +165,7 @@ impl From<diesel_models::role::Role> for RoleInfo {
Self {
role_id: role.role_id,
role_name: role.role_name,
groups: role.groups.into_iter().map(Into::into).collect(),
groups: role.groups.into_iter().collect(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
groups: role.groups.into_iter().collect(),
groups: role.groups,

@Chethan-rao Chethan-rao linked an issue Feb 25, 2025 that may be closed by this pull request
@SanchithHegde SanchithHegde changed the title chore: address Rust 1.85.0 clippy lints #7375 chore: address Rust 1.85.0 clippy lints Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: address Rust 1.85.0 clippy lints
2 participants