Skip to content

Commit a025f54

Browse files
minor: migrate from trust-dns to hickory, bump MSRV to 1.67 (#1156)
1 parent 08821ef commit a025f54

File tree

11 files changed

+23
-40
lines changed

11 files changed

+23
-40
lines changed

.evergreen/MSRV-Cargo.toml.diff

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +0,0 @@
1-
79c79
2-
< derive_more = "0.99.17"
3-
---
4-
> derive_more = "=0.99.17"
5-
100c100
6-
< serde_with = "3.8.1"
7-
---
8-
> serde_with = "=3.5.1"
9-
115a116
10-
> url = "=2.5.0"
11-
170c171
12-
< time = "0.3.9"
13-
---
14-
> time = "=0.3.20"

.evergreen/aws-lambda-test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To deploy the application, you need the folllowing tools:
3333

3434
* SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
3535
* Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community)
36-
* [Rust](https://www.rust-lang.org/) version 1.64.0 or newer
36+
* [Rust](https://www.rust-lang.org/) version 1.67.0 or newer
3737
* [cargo-lambda](https://github.com/cargo-lambda/cargo-lambda) for cross-compilation
3838

3939
To build and deploy your application for the first time, run the following in your shell:

.evergreen/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ tasks:
712712
- func: "compile only"
713713
vars:
714714
# Our minimum supported Rust version. This should be updated whenever the MSRV is bumped.
715-
RUST_VERSION: 1.64.0
715+
RUST_VERSION: 1.67.0
716716

717717
- name: check-cargo-deny
718718
tags: [lint]

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ compat-3-0-0 = []
3333
sync = []
3434
rustls-tls = ["dep:rustls", "dep:rustls-pemfile", "dep:tokio-rustls"]
3535
openssl-tls = ["dep:openssl", "dep:openssl-probe", "dep:tokio-openssl"]
36-
dns-resolver = ["dep:trust-dns-resolver", "dep:trust-dns-proto"]
36+
dns-resolver = ["dep:hickory-resolver", "dep:hickory-proto"]
3737

3838
# Enable support for MONGODB-AWS authentication.
3939
# This can only be used with the tokio-runtime feature flag.
@@ -83,6 +83,8 @@ futures-core = "0.3.14"
8383
futures-util = { version = "0.3.14", features = ["io"] }
8484
futures-executor = "0.3.14"
8585
hex = "0.4.0"
86+
hickory-proto = { version = "0.24.1", optional = true }
87+
hickory-resolver = { version = "0.24.1", optional = true }
8688
hmac = "0.12.1"
8789
once_cell = "1.19.0"
8890
log = { version = "0.4.17", optional = true }
@@ -108,8 +110,6 @@ take_mut = "0.2.2"
108110
thiserror = "1.0.24"
109111
tokio-openssl = { version = "0.6.3", optional = true }
110112
tracing = { version = "0.1.36", optional = true }
111-
trust-dns-proto = { version = "0.21.2", optional = true }
112-
trust-dns-resolver = { version = "0.21.2", optional = true }
113113
typed-builder = "0.10.0"
114114
webpki-roots = "0.25.2"
115115
zstd = { version = "0.11.2", optional = true }

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ For more details, including features, runnable examples, troubleshooting resourc
77

88
## Installation
99
### Requirements
10-
- Rust 1.64+ (See the [MSRV policy](#minimum-supported-rust-version-msrv-policy) for more information)
10+
- Rust 1.67+ (See the [MSRV policy](#minimum-supported-rust-version-msrv-policy) for more information)
1111
- MongoDB 4.0+
1212

1313
#### Supported Platforms
@@ -148,7 +148,7 @@ Commits to main are run automatically on [evergreen](https://evergreen.mongodb.c
148148

149149
## Minimum supported Rust version (MSRV) policy
150150

151-
The MSRV for this crate is currently 1.64.0. This will rarely be increased, and if it ever is,
151+
The MSRV for this crate is currently 1.67.0. This will rarely be increased, and if it ever is,
152152
it will only happen in a minor or major version release.
153153

154154
## License

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.64.0"
1+
msrv = "1.67.0"

src/client/options.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,11 @@ pub struct ClientOptions {
569569
#[derivative(Debug = "ignore")]
570570
pub(crate) original_uri: Option<String>,
571571

572-
/// Configuration of the trust-dns resolver used for SRV and TXT lookups.
572+
/// Configuration of the DNS resolver used for SRV and TXT lookups.
573573
/// By default, the host system's resolver configuration will be used.
574574
///
575-
/// On Windows, there is a known performance issue in trust-dns with using the default system
576-
/// configuration, so a custom configuration is recommended.
575+
/// On Windows, there is a known performance issue in [hickory_resolver] with using the default
576+
/// system configuration, so a custom configuration is recommended.
577577
#[builder(setter(skip))]
578578
#[serde(skip)]
579579
#[derivative(Debug = "ignore")]

src/client/options/resolver_config.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#[cfg(feature = "dns-resolver")]
2-
use trust_dns_resolver::config::ResolverConfig as TrustDnsResolverConfig;
2+
use hickory_resolver::config::ResolverConfig as HickoryResolverConfig;
33

44
/// Configuration for the upstream nameservers to use for resolution.
55
///
6-
/// This is a thin wrapper around a `trust_dns_resolver::config::ResolverConfig` provided to ensure
6+
/// This is a thin wrapper around a `hickory_resolver::config::ResolverConfig` provided to ensure
77
/// API stability.
88
#[derive(Clone, Debug, PartialEq)]
99
pub struct ResolverConfig {
1010
#[cfg(feature = "dns-resolver")]
11-
pub(crate) inner: TrustDnsResolverConfig,
11+
pub(crate) inner: HickoryResolverConfig,
1212
}
1313

1414
#[cfg(feature = "dns-resolver")]
@@ -19,7 +19,7 @@ impl ResolverConfig {
1919
/// Please see: <https://www.cloudflare.com/dns/>
2020
pub fn cloudflare() -> Self {
2121
ResolverConfig {
22-
inner: TrustDnsResolverConfig::cloudflare(),
22+
inner: HickoryResolverConfig::cloudflare(),
2323
}
2424
}
2525

@@ -30,7 +30,7 @@ impl ResolverConfig {
3030
/// ISP’s track similar information in DNS.
3131
pub fn google() -> Self {
3232
ResolverConfig {
33-
inner: TrustDnsResolverConfig::google(),
33+
inner: HickoryResolverConfig::google(),
3434
}
3535
}
3636

@@ -40,7 +40,7 @@ impl ResolverConfig {
4040
/// Please see: <https://www.quad9.net/faq/>
4141
pub fn quad9() -> Self {
4242
ResolverConfig {
43-
inner: TrustDnsResolverConfig::quad9(),
43+
inner: HickoryResolverConfig::quad9(),
4444
}
4545
}
4646
}

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl Error {
278278
}
279279

280280
#[cfg(feature = "dns-resolver")]
281-
pub(crate) fn from_resolve_error(error: trust_dns_resolver::error::ResolveError) -> Self {
281+
pub(crate) fn from_resolve_error(error: hickory_resolver::error::ResolveError) -> Self {
282282
ErrorKind::DnsResolve {
283283
message: error.to_string(),
284284
}

src/runtime/resolver.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use trust_dns_resolver::{
1+
use hickory_resolver::{
22
config::ResolverConfig,
33
error::ResolveErrorKind,
44
lookup::{SrvLookup, TxtLookup},
@@ -9,17 +9,14 @@ use crate::error::{Error, Result};
99

1010
/// An async runtime agnostic DNS resolver.
1111
pub(crate) struct AsyncResolver {
12-
resolver: trust_dns_resolver::TokioAsyncResolver,
12+
resolver: hickory_resolver::TokioAsyncResolver,
1313
}
1414

1515
impl AsyncResolver {
1616
pub(crate) async fn new(config: Option<ResolverConfig>) -> Result<Self> {
1717
let resolver = match config {
18-
Some(config) => {
19-
trust_dns_resolver::TokioAsyncResolver::tokio(config, Default::default())
20-
.map_err(Error::from_resolve_error)?
21-
}
22-
None => trust_dns_resolver::TokioAsyncResolver::tokio_from_system_conf()
18+
Some(config) => hickory_resolver::TokioAsyncResolver::tokio(config, Default::default()),
19+
None => hickory_resolver::TokioAsyncResolver::tokio_from_system_conf()
2320
.map_err(Error::from_resolve_error)?,
2421
};
2522

src/srv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl SrvResolver {
6767
original_hostname: &str,
6868
dm: DomainMismatch,
6969
) -> Result<LookupHosts> {
70-
use trust_dns_proto::rr::RData;
70+
use hickory_proto::rr::RData;
7171

7272
let hostname_parts: Vec<_> = original_hostname.split('.').collect();
7373

0 commit comments

Comments
 (0)