-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Use of mut self
in builders
#54
Comments
You can use them in separate statements: let mut builder = Config::builder()
.test_on_check_out(false);
builder = builder.helper_threads(10);
let config = builder.build(); The config contains a couple of bits of owned/non-cloneable data so |
Yeah, sorry, got muddled on that bit 😅 (really sorry for the mistake!) The article still seems to reccomend the |
This would remove the need to keep setting the builder in statement form |
Not sure this is still relevant in 2019... the blog post is gone though. |
Hi! It seems like log4rs uses
mut self
for many of the config builder methods (such as.appender
). It seems that it is preffered to use&mut self
for builders: https://aturon.github.io/ownership/builders.html#non-consuming-builders-(preferred):The text was updated successfully, but these errors were encountered: