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
Sorry for my long absence, I was very busy..
I'm glad that we now have the way to specify getters that should return by value, but would it be possible to allow the #[get_copy] attribute when only deriving Getters? Not requiring an extra derive (CopyGetters)?
Btw, what was the reason that an extra derive was added for this? I don't think there is any potential for mistakes (like accidentally specifying the wrong kind of getter), and in fact, would it be possible to allow all of getset's attributes just by deriving GetSet?
Sometimes I start out with only deriving Getters and then I add some copy-getter or setter attributes but forget to also derive CopyGetters/Setters and it's one more cargo cycle to notice that..
It would be much more convenient to only have to derive(GetSet), because usually I need getters and setters anyway, and since the goal of this crate is to add convenience & save typing, I think it'd make it even more convenient to enable all attributes at once, what do you think? :)
The text was updated successfully, but these errors were encountered:
CopyGetters, part of this was because if/when specialization ever lands we won't need it, and also because it was so heavily demanded. Using a distinct type/flag means we have a safe deprecation path.
I think allowing get_copy and get_mut from derive(Getters) is a good idea.
I also think having derive(GetSet) instead of derive(Getters, Setters) is also a good idea. :)
@Hoverbear Yes, it would be nice to have this, too. Both of these usability improvements are orthogonal (#49 is about the field attributes, this is about the struct attributes), so they work well together to improve the usability even further :)
Sorry for my long absence, I was very busy..
I'm glad that we now have the way to specify getters that should return by value, but would it be possible to allow the
#[get_copy]
attribute when only derivingGetters
? Not requiring an extra derive (CopyGetters
)?Btw, what was the reason that an extra derive was added for this? I don't think there is any potential for mistakes (like accidentally specifying the wrong kind of getter), and in fact, would it be possible to allow all of getset's attributes just by deriving
GetSet
?Sometimes I start out with only deriving
Getters
and then I add some copy-getter or setter attributes but forget to also deriveCopyGetters
/Setters
and it's one more cargo cycle to notice that..It would be much more convenient to only have to
derive(GetSet)
, because usually I need getters and setters anyway, and since the goal of this crate is to add convenience & save typing, I think it'd make it even more convenient to enable all attributes at once, what do you think? :)The text was updated successfully, but these errors were encountered: