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

Clarify naming convention of build() in section 3.2.1 #338

Open
ElykDeer opened this issue Jan 10, 2023 · 1 comment
Open

Clarify naming convention of build() in section 3.2.1 #338

ElykDeer opened this issue Jan 10, 2023 · 1 comment
Labels
A-pattern Area: Content about Patterns C-clarification Category: Content that clarifies existing content good first issue Good for newcomers

Comments

@ElykDeer
Copy link

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.

@wookietreiber
Copy link
Contributor

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.

@simonsan simonsan added the C-clarification Category: Content that clarifies existing content label Jan 10, 2023
@simonsan simonsan added good first issue Good for newcomers A-pattern Area: Content about Patterns labels Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pattern Area: Content about Patterns C-clarification Category: Content that clarifies existing content good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants