Skip to content

Conversation

@jonasXchen
Copy link
Contributor

@jonasXchen jonasXchen commented Nov 22, 2025

avoid using ::default, instead use ::new

Summary by CodeRabbit

  • Refactor
    • Updated constructor method naming convention for the ActionArgs API to follow standard practices.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 22, 2025

📝 Walkthrough

Walkthrough

The pull request renames the associated constructor method on ActionArgs from default(data: Vec<u8>) -> Self to new(data: Vec<u8>) -> Self in the magicblock-magic-program-api/src/args.rs file. The initialization logic remains unchanged, with escrow_index set to 255 and the provided data assigned. This is purely a method signature rename with no behavioral changes.

Possibly related PRs

Suggested reviewers

  • taco-paco
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jonasXchen/action-args

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aedccd9 and 678c4ea.

📒 Files selected for processing (1)
  • magicblock-magic-program-api/src/args.rs (1 hunks)
🔇 Additional comments (1)
magicblock-magic-program-api/src/args.rs (1)

16-21: Verification complete: method rename is correctly implemented.

The change from default to new is correct and has been properly applied. Ripgrep search confirms no remaining calls to ActionArgs::default exist in the codebase. Current usages in test-integration/programs/flexi-counter/src/processor/schedule_intent.rs (lines 73, 112) use struct literal syntax (ActionArgs { ... }), which is valid and doesn't require the new method. No impl Default for ActionArgs exists, which is appropriate since the constructor requires a parameter.


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
Copy link

Manual Deploy Available

You can trigger a manual deploy of this PR branch to testnet:

Deploy to Testnet 🚀

Alternative: Comment /deploy on this PR to trigger deployment directly.

⚠️ Note: Manual deploy requires authorization. Only authorized users can trigger deployments.

Comment updated automatically when the PR is synchronized.

@jonasXchen jonasXchen merged commit f478de0 into master Nov 23, 2025
18 checks passed
@jonasXchen jonasXchen deleted the jonasXchen/action-args branch November 23, 2025 06:14
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.

3 participants