api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

Missing setter convention described in RFC344

Open duskmoon314 opened this issue 9 months ago • 1 comments

In RFC344, setter is described as:

* A method `set_foo(&self, val: T)` for setting the field. (The `val` argument
  here may take `&T` or some other type, depending on the context.)

This was once added in commit a29a8417baa2722a5a9c17e48f2ff16bf35d6eb6

However, the current guideline only describes C-GETTER and does not describe how the setter should be named. Given that there are many results when searching for set_ in the std, I assume this is still the naming convention of the setter. search results

Should we add a description, or is this not suggested, and some API should be adjusted?

duskmoon314 avatar May 23 '24 03:05 duskmoon314