Skip to content

get_mut should imply set, which should imply get #4

@Boscop

Description

@Boscop

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions