Skip to content

fix(platform-wallet): satisfy accessors clippy lints#3596

Draft
thepastaclaw wants to merge 1 commit intodashpay:v3.1-devfrom
thepastaclaw:fix/platform-wallet-clippy-v31
Draft

fix(platform-wallet): satisfy accessors clippy lints#3596
thepastaclaw wants to merge 1 commit intodashpay:v3.1-devfrom
thepastaclaw:fix/platform-wallet-clippy-v31

Conversation

@thepastaclaw
Copy link
Copy Markdown
Collaborator

@thepastaclaw thepastaclaw commented May 5, 2026

fix(platform-wallet): satisfy accessors clippy lints

Issue being fixed or feature implemented

Fixes cargo clippy -p platform-wallet --all-targets -- -D warnings failures
on v3.1-dev caused by newly-denied clippy lints in
PlatformWalletManager accessors.

What was done?

  • Replaced a manual Option fallback with .unwrap_or_default().
  • Removed an unnecessary u32 -> u32 cast from wallet identity row snapshots.
  • Replaced a redundant closure with the helper function directly.

How Has This Been Tested?

  • cargo fmt --all
  • cargo clippy -p platform-wallet --all-targets -- -D warnings
  • Pre-PR code review gate: ship

Breaking Changes

None.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the
    corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Refactor
    • Simplified internal code patterns for improved maintainability and consistency. No user-facing changes or API modifications.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97006e5e-f511-48f8-8e94-08b01f06c4e9

📥 Commits

Reviewing files that changed from the base of the PR and between d507193 and 982c6f7.

📒 Files selected for processing (1)
  • packages/rs-platform-wallet/src/manager/accessors.rs

📝 Walkthrough

Walkthrough

The PR refactors three accessor functions in the wallet manager by simplifying how they compute or assign values. Changes replace a manual match expression with unwrap_or_default(), remove an unnecessary type cast, and compress address collection into a single iterator chain.

Changes

Accessor Function Simplifications

Layer / File(s) Summary
Core Logic Refactoring
packages/rs-platform-wallet/src/manager/accessors.rs
identity_sync_config_blocking replaces explicit match None => 0 with try_queue_depth().unwrap_or_default(); identity_manager_wallet_identities_blocking removes redundant as u32 cast on *reg_idx assignment; pool_snapshot compresses address iteration into a single method chain.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Three little tweaks in the accessor flow,
Match becomes unwrap_or_default()—watch it go!
Casts disappear, iterators align,
Simpler code in a language so fine! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: resolving clippy lints in the platform-wallet accessors module through code simplifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added this to the v3.1.0 milestone May 5, 2026
@thepastaclaw
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw
Copy link
Copy Markdown
Collaborator Author

thepastaclaw commented May 5, 2026

✅ Review complete (commit 982c6f7)

Copy link
Copy Markdown
Collaborator Author

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

Behavior-preserving clippy cleanup in packages/rs-platform-wallet/src/manager/accessors.rs. Verified against source: try_queue_depth() returns Option<usize> so unwrap_or_default() yields 0 (matches the prior None => 0 arm); RegistrationIndex is a u32 alias so as u32 is redundant; replacing |info| addr_info_snapshot(info) with addr_info_snapshot is a pure refactor. No correctness, security, or architectural concerns.

Reviewed commit: 982c6f7

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.

1 participant