-
Notifications
You must be signed in to change notification settings - Fork 163
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
RUST-911: Add srvServiceName URI option #1235
base: main
Are you sure you want to change the base?
Conversation
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.
looking good so far - we'll also need to implement the prose test described here
src/srv.rs
Outdated
@@ -90,14 +94,21 @@ pub(crate) enum DomainMismatch { | |||
#[cfg(feature = "dns-resolver")] | |||
pub(crate) struct SrvResolver { | |||
resolver: crate::runtime::AsyncResolver, | |||
client_options: Option<ClientOptions>, |
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.
suggest only storing the service name rather than the entire options struct - it looks like that's the only field being accessed from this
src/srv.rs
Outdated
.unwrap_or(default_service_name), | ||
}; | ||
let lookup_hostname = format!("_{}._tcp.{}", service_name, original_hostname); | ||
.unwrap_or("mongodb".to_string()), |
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.
tiny style nit: we can do the following to avoid allocating an extra string here
self.srv_service_name
.as_deref() // converts into an Option<&str> to get a reference to the inner string
.unwrap_or("mongodb")
disregard my comment about assertions, I misread which method was being called! |
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.
lgtm!
RUST-911