From 3c63ecc9c5eb42d3edd22b5f07e6a7c818825d1e Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sun, 26 Sep 2021 21:26:10 +0800 Subject: [PATCH] make clippy happy, ResolverOpts initlalize with Default::default() --- .../src/dns_resolver/trust_dns_resolver.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/shadowsocks/src/dns_resolver/trust_dns_resolver.rs b/crates/shadowsocks/src/dns_resolver/trust_dns_resolver.rs index a0df63921056..53f95e5e07b9 100644 --- a/crates/shadowsocks/src/dns_resolver/trust_dns_resolver.rs +++ b/crates/shadowsocks/src/dns_resolver/trust_dns_resolver.rs @@ -13,11 +13,12 @@ pub async fn create_resolver(dns: Option, _ipv6_first: bool) -> // Customized dns resolution match dns { Some(conf) => { - let mut resolver_opts = ResolverOpts::default(); - - // Use Ipv4AndIpv6 strategy. Because Ipv4ThenIpv6 or Ipv6ThenIpv4 will return if the first query returned. - // Since we want to use Happy Eyeballs to connnect to both IPv4 and IPv6 addresses, we need both A and AAAA records. - resolver_opts.ip_strategy = LookupIpStrategy::Ipv4AndIpv6; + let resolver_opts = ResolverOpts { + // Use Ipv4AndIpv6 strategy. Because Ipv4ThenIpv6 or Ipv6ThenIpv4 will return if the first query returned. + // Since we want to use Happy Eyeballs to connnect to both IPv4 and IPv6 addresses, we need both A and AAAA records. + ip_strategy: LookupIpStrategy::Ipv4AndIpv6, + ..ResolverOpts::default() + }; trace!( "initializing DNS resolver with config {:?} opts {:?}",