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

Fix doc for OptsBuilder #247

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Conversation

yerke
Copy link
Contributor

@yerke yerke commented Aug 25, 2020

Fix doc for OptsBuilder

@@ -424,19 +424,19 @@ impl Opts {
/// Provides a way to build [`Opts`](struct.Opts.html).
///
/// ```ignore
/// let mut ssl_opts = SslOpts::new();
Copy link
Contributor Author

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")
Copy link
Contributor Author

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");
Copy link
Contributor Author

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"))
Copy link
Contributor Author

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.

@blackbeam blackbeam merged commit 0cbc0c0 into blackbeam:master Aug 25, 2020
@blackbeam
Copy link
Owner

Thanks!

@yerke yerke deleted the fix-opts-builder-doc branch August 25, 2020 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants