Open Arnavion opened 7 years ago
I dislike emitting #[allow(missing_docs)]
and would prefer a solution that allowed everything to be documented reasonably well.
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.
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.
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.")]