-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add conversion from &IbcEvent to abci::Event #438
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
==========================================
- Coverage 71.52% 71.51% -0.02%
==========================================
Files 125 125
Lines 15890 15897 +7
==========================================
+ Hits 11365 11368 +3
- Misses 4525 4529 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
@@ -0,0 +1,2 @@ | |||
- Allow conversion from &IbcEvent to abci::Event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put this under breaking-changes
instead?
Sorry I am just seeing this now which is a bit late. Just wanted to note that it's a bit of an anti pattern to implement From on references, as it forces a clone on conversion even when the caller already has a owned value, ie. if one has a owned event, one has to take a reference to it before calling into and this will clone the data under the hood. In general in Rust it's good practice to make it clear whether or not a conversion or function will allocate or not, and let the caller allocate if necessary rather than hide allocations under "easy to use" API. As such I would suggest reverting this PR. |
For reference, here's what I mean, explained in code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=64d53eefc220d1a600089f08e3119ac6 |
* impl Convert from &IbcEvent to abci::Event * Create 416-conver-ref-ibc_event2abci_event.md * change TryFrom IbcEvent by IbcEvent reference * Update events.rs * mvoe to breaking-changes fold
Closes: #416
Description
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.