-
Notifications
You must be signed in to change notification settings - Fork 60
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
Removing the with_
prefix from builder methods
#113
Comments
Hmm so you mean it'd look like |
Yes, that's what I meant. It is the recommended way of naming builder methods and should be familiar to many users, because it is used in many places like https://doc.rust-lang.org/std/process/struct.Command.html, https://docs.rs/clap/latest/clap/struct.Arg.html or https://docs.rs/embedded-graphics/latest/embedded_graphics/text/struct.TextStyleBuilder.html. |
remove `with_` prefix from Builder, fixes #113
Updates to the names of methods on the `Builder` merged in PR almindor#113 missed updating the TROUBLESHOOTING.md file
Should we remove the
with_
prefix from the builder methods? The API guidelines state that thewith_
prefix should be used for constructors (https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case) and builders usually don't use and prefix for the methods (https://rust-lang.github.io/api-guidelines/type-safety.html?highlight=builder#builders-enable-construction-of-complex-values-c-builder).The naming is confusing in the latest release where
Builder::with_model
is a constructor, while other methods, likeBuilder::with_orientation
, are used to set a parameters. In the master branchwith_model
was renamed intonew
, which makes it harder to mix up the two types of methods, but I would still prefer to remove the prefix.The text was updated successfully, but these errors were encountered: