-
Notifications
You must be signed in to change notification settings - Fork 277
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
[fix] #1917: Added easy_from_str_impl macro for use with AssetValueType #2054
[fix] #1917: Added easy_from_str_impl macro for use with AssetValueType #2054
Conversation
84ea691
to
1fdbff9
Compare
1fdbff9
to
aeecc31
Compare
…with AssetValueType Signed-off-by: Sam H. Smith <[email protected]>
Signed-off-by: Sam H. Smith <[email protected]>
aeecc31
to
75961f7
Compare
} | ||
|
||
easy_from_str_impl! {AssetValueType, Quantity, BigQuantity, Fixed, Store} |
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.
Just to mention for future macros. I think that's not a good tradition in Iroha to write such simple to implement but hard to read syntax.
Take a look at this rule:
Rust macros let you dream up practically whatever input syntax you want. Aim to keep input syntax familiar and cohesive with the rest of your users' code by mirroring existing Rust syntax where possible. Pay attention to the choice and placement of keywords and punctuation.
…er-iroha#2054) Signed-off-by: Sam H. Smith <[email protected]>
…er-iroha#2054) Signed-off-by: Sam H. Smith <[email protected]>
…er-iroha#2054) Signed-off-by: Sam H. Smith <[email protected]>
…er-iroha#2054) Signed-off-by: Sam H. Smith <[email protected]>
…er-iroha#2054) Signed-off-by: Sam H. Smith <[email protected]>
…er-iroha#2054) Signed-off-by: Sam H. Smith <[email protected]>
Description of the Change
Created a variadic declarative macro that implements FromStr for C like enums.
Issue
#1917
Benefits
Future FromStr implementations for C like enums can be a lot smaller codesize.
Possible Drawbacks
May be harder to read and understand for some.