-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix doc for OptsBuilder #247
Conversation
@@ -424,19 +424,19 @@ impl Opts { | |||
/// Provides a way to build [`Opts`](struct.Opts.html). | |||
/// | |||
/// ```ignore | |||
/// let mut ssl_opts = SslOpts::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SslOpts::new()
doesn't exist, so we need to SslOpts::default()
.
@@ -424,19 +424,19 @@ impl Opts { | |||
/// Provides a way to build [`Opts`](struct.Opts.html). | |||
/// | |||
/// ```ignore | |||
/// let mut ssl_opts = SslOpts::new(); | |||
/// ssl_opts.set_pkcs12_path("/foo/cert.p12") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.set_pkcs12_path()
doesn't exist, so we need to use .with_pkcs12_path()
.
@@ -424,19 +424,19 @@ impl Opts { | |||
/// Provides a way to build [`Opts`](struct.Opts.html). | |||
/// | |||
/// ```ignore | |||
/// let mut ssl_opts = SslOpts::new(); | |||
/// ssl_opts.set_pkcs12_path("/foo/cert.p12") | |||
/// .set_root_ca_path("/foo/root_ca.der"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. .set_root_ca_path()
doesn't exist, so we need to use .with_root_ca_path()
.
/// .db_name(Some("bar")) | ||
/// .ssl_opts(Some(ssl_opts)); | ||
/// | ||
/// // Or use existing T: Into<Opts> | ||
/// let mut builder = OptsBuilder::from_opts(existing_opts); | ||
/// builder.ip_or_hostname(Some("foo")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work, since builder
will be moved here. So we can either use a mutable variable and assign to it after modifications (like in example above), or we can go Builder pattern all the way.
Thanks! |
Fix doc for OptsBuilder