-
Notifications
You must be signed in to change notification settings - Fork 569
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
Expose derived lenses as associated constants #352
Conversation
e8682b8
to
554153b
Compare
Updated to define the lenses in a public module with some documentation. This makes things a little prettier; it's not perfect but I think it's pretty good. Example error from using a lens of the wrong type:
|
554153b
to
65a4496
Compare
My only nit might be to add |
We'll be able to get rid of the public module when rust-lang/rust#63065 comes along. |
want to make that name tweak? then I'm happy to merge, this is a solid improvement. |
65a4496
to
13a76a1
Compare
Done, plus some brief documentation. |
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.
great, thanks, appreciate the attention to detail.
Generates lens type definitions inside a private module with an unlikely-to-collide name, then uses those to populate associated constants on the type for extremely ergonomic access. The main drawback here is that the private
__Foo_druid_lenses
module name pops up in error messages.