Skip to content

Conversation

@prajapatipratik460
Copy link

Type of Change

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

Description

Fixed redundant commas and formatting inconsistencies across the codebase:

  • Remove trailing commas from function signatures in gw_filter_new.rs
  • Fix redundant parentheses in match expressions in gateway_scoring_service.rs
  • Clean up function call formatting in gw_filter_new.rs
  • Improve overall code readability and consistency

Files Modified:

1. src/decider/gatewaydecider/gw_filter_new.rs

  • Line 298: Removed trailing comma from function call
    • PaymentFlow::CVVLESS,).await;PaymentFlow::CVVLESS).await;
  • Line 2326: Removed trailing comma from function signature
    • filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>,)filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>)
  • Line 2344: Removed trailing comma from function signature
    • filterGatewaysForReward(this: &mut DeciderFlow<'_>,)filterGatewaysForReward(this: &mut DeciderFlow<'_>)
  • Line 2371: Removed trailing comma from function signature
    • filterGatewaysForCash(this: &mut DeciderFlow<'_>,)filterGatewaysForCash(this: &mut DeciderFlow<'_>)
  • Line 2385: Removed trailing comma from function signature
    • filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<'_>,)
      filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<'_>)
  • Line 2494: Removed trailing comma from function signature
    • log_final_functional_gateways(this: &mut DeciderFlow<'_>,)log_final_functional_gateways(this: &mut DeciderFlow<'_>)
  • Line 2498: Removed trailing comma from function signature
    • filterGatewaysForPaymentMethod(this: &mut DeciderFlow<'_>,)filterGatewaysForPaymentMethod(this: &mut DeciderFlow<'_>)

2. src/feedback/gateway_scoring_service.rs

  • Lines 371-383: Removed redundant parentheses from match expression
    • match (gateway_scoring_type)match gateway_scoring_type
    • (GatewayScoringType::Penalise)GatewayScoringType::Penalise
    • (GatewayScoringType::PenaliseSrv3)GatewayScoringType::PenaliseSrv3
    • (GatewayScoringType::Reward)GatewayScoringType::Reward

3. src/feedback/utils.rs

  • Line 876: Removed redundant parentheses
    • (MandateTxnType::Default)MandateTxnType::Default

4. src/decider/gatewaydecider/flow_new.rs

  • Lines 477-498: Improved struct initialization formatting (automatic cargo fmt changes)

Summary:

  • 7 function signatures fixed (removed trailing commas)
  • 1 function call fixed (removed trailing comma)
  • 4 match arms fixed (removed redundant parentheses)
  • 1 return statement fixed (removed redundant parentheses)
  • Automatic formatting applied to maintain consistency

Additional Changes

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

Motivation and Context

Fixes: #149

Addresses formatting issues that reduce code clarity and create inconsistent diffs. These style improvements enhance
maintainability and follow Rust best practices for clean, readable code.

How did you test it?

  • Verified code compiles without errors
  • Ran cargo clippy to ensure no linting warnings
  • Ran cargo fmt --check to verify consistent formatting
  • Confirmed all redundant commas and parentheses removed

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX]: Comma/formatting errors

1 participant