Skip to content
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

Doc comments #4

Open
Arnavion opened this issue Nov 26, 2016 · 3 comments
Open

Doc comments #4

Arnavion opened this issue Nov 26, 2016 · 3 comments

Comments

@Arnavion
Copy link

  • Emit #[allow(missing_docs)] on the impl block.

  • Reuse doc comments on the fields for the corresponding getters and setters. The comments won't be exactly in the style that getters should have and even worse for setters, but it may be better than nothing. My getters macro does this.

  • You could also support overriding the doc comment with a field-level attribute like #[getter(doc = "Gets the foo.")] #[setter(doc = "Sets the foo.")]

@emk
Copy link
Owner

emk commented Nov 26, 2016

I dislike emitting #[allow(missing_docs)] and would prefer a solution that allowed everything to be documented reasonably well.

@Arnavion
Copy link
Author

The reason for emitting #[allow(missing_docs)] is for the case where the field has no doc comment and no #[getter(doc)] attribute. I guess you could synthesize something like Gets the `field_name` field of the `StructName`. instead.

@Arnavion
Copy link
Author

https://github.com/Arnavion/accessors/commit/befff9ae9de1c5905bbe24eb9d4d4d5111a1a7a5 implements the second and third item, but requires the other commits from #5, so I'll wait for that to be merged first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants