Skip to content

Conversation

@SanchithHegde
Copy link
Member

Type of Change

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

Description

This PR addresses clippy lints due to Rust version 1.91.0. Additionally, this PR includes some general / minor improvements outlined below.

  • Bumped tokio crate to version 1.48.0, since code expanded from #[tokio::main] and #[tokio::test] macros triggered warnings. (See macros: suppress clippy::unwrap_in_result in #[tokio::main] tokio-rs/tokio#7651.)
  • Allowed expect / panic / print / unwrap in tests by configuring lints in the .clippy.toml file and removing the respective #[allow(...)] attributes.
  • Removed redundant crate imports across the codebase, such as use serde;.
  • Removed a couple of allow(unknown_lints) annotations in the scheduler crate, since I believe they should no longer throw warnings on our current MSRV (1.85.0).
  • Corrected an error message passed to expect() in the validate_card_number_chars() function in the cards crate. Technically, this error message should never be seen on production, as the conditions where the expect() is called should never occur.

Motivation and Context

This PR addresses clippy lints arising due to a new Rust version.

How did you test it?

just clippy and just clippy_v2 pass locally when run with Rust 1.91 locally. Additionally, existing CI checks should also pass (such as stable and MSRV toolchain checks).

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

@SanchithHegde SanchithHegde self-assigned this Nov 6, 2025
@SanchithHegde SanchithHegde requested review from a team as code owners November 6, 2025 15:36
@SanchithHegde SanchithHegde added the A-dependencies Area: Dependencies label Nov 6, 2025
@SanchithHegde SanchithHegde requested review from a team as code owners November 6, 2025 15:36
@SanchithHegde SanchithHegde added the C-refactor Category: Refactor label Nov 6, 2025
@SanchithHegde SanchithHegde requested review from a team as code owners November 6, 2025 15:36
@semanticdiff-com
Copy link

semanticdiff-com bot commented Nov 6, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/tests/connectors/authipay.rs  89% smaller
  crates/test_utils/tests/connectors/selenium.rs  81% smaller
  crates/router/tests/payments.rs  60% smaller
  crates/router/tests/payments2.rs  47% smaller
  crates/cards/src/validate.rs  22% smaller
  crates/openapi/src/routes/subscriptions.rs  4% smaller
  crates/masking/tests/basic.rs  1% smaller
  .clippy.toml Unsupported file format
  Cargo.lock Unsupported file format
  crates/analytics/Cargo.toml Unsupported file format
  crates/api_models/src/api_keys.rs  0% smaller
  crates/api_models/src/ephemeral_key.rs  0% smaller
  crates/api_models/src/payments.rs  0% smaller
  crates/api_models/src/tokenization.rs  0% smaller
  crates/common_enums/src/enums/accounts.rs  0% smaller
  crates/common_enums/src/enums/payments.rs  0% smaller
  crates/common_enums/src/transformers.rs  0% smaller
  crates/common_utils/Cargo.toml Unsupported file format
  crates/common_utils/src/crypto.rs  0% smaller
  crates/common_utils/src/id_type.rs  0% smaller
  crates/common_utils/src/id_type/global_id.rs  0% smaller
  crates/common_utils/src/lib.rs  0% smaller
  crates/common_utils/src/macros.rs  0% smaller
  crates/common_utils/src/payout_method_utils.rs  0% smaller
  crates/common_utils/src/types.rs  0% smaller
  crates/connector_configs/src/connector.rs  0% smaller
  crates/currency_conversion/src/conversion.rs  0% smaller
  crates/diesel_models/src/authentication.rs  0% smaller
  crates/diesel_models/src/process_tracker.rs  0% smaller
  crates/diesel_models/src/query/utils.rs  0% smaller
  crates/diesel_models/src/tokenization.rs  0% smaller
  crates/drainer/Cargo.toml Unsupported file format
  crates/euclid/src/backend/vir_interpreter.rs  0% smaller
  crates/euclid/src/dssa/analyzer.rs  0% smaller
  crates/euclid/src/dssa/graph.rs  0% smaller
  crates/euclid/src/dssa/state_machine.rs  0% smaller
  crates/euclid/src/frontend/dir.rs  0% smaller
  crates/external_services/Cargo.toml Unsupported file format
  crates/external_services/build.rs  0% smaller
  crates/external_services/src/aws_kms/core.rs  0% smaller
  crates/external_services/src/crm.rs  0% smaller
  crates/external_services/src/grpc_client.rs  0% smaller
  crates/external_services/src/grpc_client/dynamic_routing.rs  0% smaller
  crates/hsdev/src/main.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/amazonpay.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/nmi.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/payjustnow.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/signifyd/transformers/auth.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs  0% smaller
  crates/hyperswitch_domain_models/src/connector_endpoints.rs  0% smaller
  crates/hyperswitch_domain_models/src/payment_methods.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs  0% smaller
  crates/hyperswitch_domain_models/src/routing.rs  0% smaller
  crates/hyperswitch_domain_models/src/tokenization.rs  0% smaller
  crates/hyperswitch_domain_models/src/vault.rs  0% smaller
  crates/injector/Cargo.toml Unsupported file format
  crates/injector/src/injector.rs  0% smaller
  crates/injector/src/vault_metadata.rs  0% smaller
  crates/kgraph_utils/src/mca.rs  0% smaller
  crates/masking/src/secret.rs  0% smaller
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  0% smaller
  crates/redis_interface/Cargo.toml Unsupported file format
  crates/redis_interface/src/commands.rs  0% smaller
  crates/router/Cargo.toml Unsupported file format
  crates/router/src/configs/settings.rs  0% smaller
  crates/router/src/connector/utils.rs  0% smaller
  crates/router/src/consts.rs  0% smaller
  crates/router/src/consts/user.rs  0% smaller
  crates/router/src/core/api_keys.rs  0% smaller
  crates/router/src/core/payments.rs  0% smaller
  crates/router/src/core/payments/access_token.rs  0% smaller
  crates/router/src/core/payments/helpers.rs  0% smaller
  crates/router/src/core/payments/operations/payment_cancel.rs  0% smaller
  crates/router/src/core/payments/operations/payment_cancel_post_capture.rs  0% smaller
  crates/router/src/core/payments/operations/payment_cancel_v2.rs  0% smaller
  crates/router/src/core/payments/operations/payment_reject.rs  0% smaller
  crates/router/src/core/payments/operations/payment_response.rs  0% smaller
  crates/router/src/core/payments/operations/payments_extend_authorization.rs  0% smaller
  crates/router/src/core/payouts.rs  0% smaller
  crates/router/src/core/pm_auth.rs  0% smaller
  crates/router/src/core/tokenization.rs  0% smaller
  crates/router/src/core/utils.rs  0% smaller
  crates/router/src/core/webhooks/outgoing_v2.rs  0% smaller
  crates/router/src/db/api_keys.rs  0% smaller
  crates/router/src/db/dispute.rs  0% smaller
  crates/router/src/db/events.rs  0% smaller
  crates/router/src/db/locker_mock_up.rs  0% smaller
  crates/router/src/db/merchant_connector_account.rs  0% smaller
  crates/router/src/db/merchant_key_store.rs  0% smaller
  crates/router/src/db/relay.rs  0% smaller
  crates/router/src/routes/payment_methods.rs  0% smaller
  crates/router/src/routes/refunds.rs  0% smaller
  crates/router/src/routes/tokenization.rs  0% smaller
  crates/router/src/services/encryption.rs  0% smaller
  crates/router/src/services/kafka/payment_intent.rs  0% smaller
  crates/router/src/types/api.rs  0% smaller
  crates/router/src/types/api/payments.rs  0% smaller
  crates/router/src/types/api/poll.rs  0% smaller
  crates/router/src/types/storage/payment_attempt.rs  0% smaller
  crates/router/src/workflows/payment_sync.rs  0% smaller
  crates/router/tests/cache.rs  0% smaller
  crates/router/tests/connectors/dlocal.rs  0% smaller
  crates/router/tests/customers.rs  0% smaller
  crates/router/tests/integration_demo.rs  0% smaller
  crates/router/tests/macros.rs  0% smaller
  crates/router/tests/payouts.rs  0% smaller
  crates/router/tests/refunds.rs  0% smaller
  crates/router/tests/services.rs  0% smaller
  crates/router/tests/utils.rs  0% smaller
  crates/router_env/Cargo.toml Unsupported file format
  crates/router_env/tests/env.rs  0% smaller
  crates/router_env/tests/logger.rs  0% smaller
  crates/scheduler/Cargo.toml Unsupported file format
  crates/scheduler/src/consumer.rs  0% smaller
  crates/scheduler/src/producer.rs  0% smaller
  crates/storage_impl/Cargo.toml Unsupported file format
  crates/test_utils/Cargo.toml Unsupported file format

@SanchithHegde SanchithHegde linked an issue Nov 6, 2025 that may be closed by this pull request
Copy link
Contributor

@inventvenkat inventvenkat left a comment

Choose a reason for hiding this comment

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

Reviewed clippy.toml

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@359fcc0). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10162   +/-   ##
=======================================
  Coverage        ?    3.89%           
=======================================
  Files           ?     1224           
  Lines           ?   303130           
  Branches        ?        0           
=======================================
  Hits            ?    11804           
  Misses          ?   291326           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 7, 2025
Merged via the queue into main with commit a6d1a3a Nov 7, 2025
36 of 42 checks passed
@likhinbopanna likhinbopanna deleted the clippy-1.91 branch November 7, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-dependencies Area: Dependencies C-refactor Category: Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: address Rust 1.91.0 clippy lints

8 participants