get_mut should imply set, which should imply get
Boscop opened this issue · 1 comments
Boscop commented
I'm using this crate a lot and it's making my struct definitions kinda verbose, so I propose this idea to reduce the verbosity:
Whenever a field has #[set]
, it should also automatically get a getter, and when it has get_mut it should automatically get a setter and getter, because get_mut already can be used as a setter but the actual set() should be generated for convenience. And we can assume that whenever a field has a setter, the author usually also wants it to have a getter as well. In those rare circumstances when that is not the case, the author can just write a manual setter instead of using the attribute.
What do you think?