patterns icon indicating copy to clipboard operation
patterns copied to clipboard

Clarify naming convention of `build()` in section 3.2.1

Open ElykDeer opened this issue 3 years ago • 1 comments

The current builder design pattern implies that the method the produces whatever is being built should be named build(), which seems to contradict the Rust API Guidelines on the same subject.

I think there should be some clarifying language around this: whether the method should always be named build(), or be adapted to fit the API.

ElykDeer avatar Jan 10 '23 02:01 ElykDeer

IMO recommending build() as a default is fine, if you can't think of any other name. I agree with you that clarification about this is good, e.g. a note that says something like that build() is used in the example, but if your API supports it to choose a better name, same as the API Guidelines say about the name of the builder type.

wookietreiber avatar Jan 10 '23 09:01 wookietreiber