-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add From
derive to Currency
enum
#87
Conversation
This update adds the `From` derive to the `Currency` enum to enable more convenient type conversions. It facilitates smoother integration by allowing conversions directly from component types.
WalkthroughThe changes introduce a new derive macro, Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)src/entities/currency.rs (2)
The addition of Line range hint The addition of
This enables more ergonomic conversions using Let's verify there are no conflicting conversion implementations: ✅ Verification successfulLGTM: No conflicting type conversion implementations found The search results show that there are no existing manual 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for existing From implementations or manual conversion methods
# that might conflict with the new derive
# Look for existing From implementations
ast-grep --pattern 'impl From<$_> for Currency {
$$$
}'
# Look for existing conversion methods
rg -l 'fn (into|from|to).*Currency'
Length of output: 97 Script: #!/bin/bash
# Let's try a broader search to catch any potential type conversions or implementations
# Search for any impl blocks involving Currency
ast-grep --pattern 'impl $_ for Currency {
$$$
}'
# Search for any method definitions involving Currency
rg 'impl.*Currency|fn.*Currency' -A 3
# Search for any usage of Currency with into() or from() methods
rg '(into|from)\(\).*Currency|Currency::(into|from)'
# Look for any type conversion patterns involving Currency
rg '(as|into|from).*Currency'
Length of output: 5931 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This update adds the
From
derive to theCurrency
enum to enable more convenient type conversions. It facilitates smoother integration by allowing conversions directly from component types.Summary by CodeRabbit
New Features
Currency
enum functionality with the addition of theFrom
derive macro, facilitating easier conversions.Bug Fixes
Documentation
Tests
Currency
andEther
continue to function as expected.