You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deriving ShortHand will increase the compile time and on internal types, it might be better to simply make all fields public. The problem with having fields public in a user facing api is, that a lot of things could break the api, for example adding a new field to a struct would break existing uses and therefore would require a version bump. This is not a problem in private apis.
A warning should be silenceable, but this is blocked on the stabilization of the diagnostic api. I think, that warning might be a very good way, to make the library author think about how this macro impacts performance. (yes compile times are currently a real issue and I think, that by having multiple dependencies using shorthand, this could become a real problem, because hundreds of functions have to be generated and maybe only a few are used?)
Every struct, that is not pub should be warned against
Note
This should only check the visibility of the entire struct and not the visibility attribute!
While we are at it, the macro should panic, if the visibility of a field is more, than the function visibility. Why bother using a getter/setter, when you could just modify the field itself.
The text was updated successfully, but these errors were encountered:
deriving
ShortHand
will increase the compile time and on internal types, it might be better to simply make all fields public. The problem with having fields public in a user facing api is, that a lot of things could break the api, for example adding a new field to a struct would break existing uses and therefore would require a version bump. This is not a problem in private apis.A warning should be silenceable, but this is blocked on the stabilization of the diagnostic api. I think, that warning might be a very good way, to make the library author think about how this macro impacts performance. (yes compile times are currently a real issue and I think, that by having multiple dependencies using shorthand, this could become a real problem, because hundreds of functions have to be generated and maybe only a few are used?)
Every struct, that is not
pub
should be warned againstNote
This should only check the visibility of the entire struct and not the visibility attribute!
While we are at it, the macro should panic, if the visibility of a field is more, than the function visibility. Why bother using a getter/setter, when you could just modify the field itself.
The text was updated successfully, but these errors were encountered: