-
Notifications
You must be signed in to change notification settings - Fork 37
Use delegate-attr to replace delegate #275
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
Conversation
Hi, thanks for the PR! At a glance, it seems like these libraries are a wash for our use case; the bulk of this PR removes a level of indentation. Are there other benefits to using the |
Codecov Report
@@ Coverage Diff @@
## main #275 +/- ##
==========================================
+ Coverage 91.44% 91.49% +0.05%
==========================================
Files 56 55 -1
Lines 8241 8093 -148
==========================================
- Hits 7536 7405 -131
+ Misses 705 688 -17
Continue to review full report at Codecov.
|
Our |
I think this way the code looks cleaner, and more friendlier to things like code formatter, as it uses attribute macro rather than function-style macro, for which the formatter can't really know what to do.
Hmmm, it's very interesting. I think this is a bug of rustfmt, and I'm raising a PR to fix it. In the mean time I think replacing |
As this achieves the same thing as our current code but with slightly different syntax, I'm inclined to leave our code as-is. If |
I don't think there will be much performance difference as it's just a proc macro... I would note that I think delegate-attr should have a better test coverage, though. |
Issue #, if available:
Description of changes: use
delegate-attr
macro to replacedelegate
, which should have a nicer syntax.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.