-
Notifications
You must be signed in to change notification settings - Fork 89
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 first impl #4
Conversation
wow, that was fast - I will need some time for that. :-) |
I think it makes sense to land a pretty basic version and add stuff one feature at a time. This has a few tests (but not nearly enough) and just implements setters. I need to investigate how to best generate getter names. I really want this to generate idiomatic Rust, so getters names would be prefixed with If I read rust-lang/rust#29599 correctly, it's not possible to generate A more creative solution for stable might be creating a single |
Btw, feel free to enable travis and configure it some more (to render docs and stuff) – I just added a basic file so we don't forget about it :) |
/// ## Gotchas | ||
/// | ||
/// - Tuple structs and unit structs are not supported as they have no field | ||
/// names. |
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.
That's ok for me. I think it's not worth the effort to try to support them - because some kind of implicit naming is needed after all. So let's just require explicitness here. :-)
looks awesome. :-) |
PS: added travis.yml in master - please feel free to finetune it. I just copied a template from another project...
|
Let me just rebase this on master to make it mergeable again. |
This can derive impls for setters. I think getters will be a bit trickier since we have to concatenate `get_` and the field name. IIRC, that is either impossible or really hard with `macro_rules!` macros.
d94bd7c
to
0f0740c
Compare
5235801
to
42291d7
Compare
I added
I'm not sure. I might be clever enough to tell us that we are not testing all the code the macro is generating. Let's wait and see what it says. |
Yippieh :-) Btw: Do you prefer a squashed merge or the usual one in these cases? |
I prefer regular merges with all commits/history intact, since I try to build up features and it's nice to see how something was put together. When there are too many small fixes in response to feedback I'm cool with squashing those, though. |
Sorry, I couldn't stop myself! 😄
Best review by reading the commits one after another.