Skip to content

Commit c789444

Browse files
rybartlomieju
andauthored
chore: upgrade trust-dns-resolver and friends (#24108)
To avoid duplicate winreg crate in #24056 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
1 parent 566adb7 commit c789444

File tree

5 files changed

+99
-52
lines changed

5 files changed

+99
-52
lines changed

Cargo.lock

Lines changed: 80 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/net/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ rustls-tokio-stream.workspace = true
2121
serde.workspace = true
2222
socket2.workspace = true
2323
tokio.workspace = true
24-
trust-dns-proto = "0.22"
25-
trust-dns-resolver = { version = "0.22", features = ["tokio-runtime", "serde-config"] }
24+
trust-dns-proto = "0.23"
25+
trust-dns-resolver = { version = "0.23", features = ["tokio-runtime", "serde-config"] }

ext/net/ops.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ where
587587
}
588588
}
589589

590-
let resolver = AsyncResolver::tokio(config, opts)?;
590+
let resolver = AsyncResolver::tokio(config, opts);
591591

592592
let lookup_fut = resolver.lookup(query, record_type);
593593

@@ -781,9 +781,15 @@ mod tests {
781781
use std::path::Path;
782782
use std::sync::Arc;
783783
use std::sync::Mutex;
784+
use trust_dns_proto::rr::rdata::a::A;
785+
use trust_dns_proto::rr::rdata::aaaa::AAAA;
784786
use trust_dns_proto::rr::rdata::caa::KeyValue;
785787
use trust_dns_proto::rr::rdata::caa::CAA;
786788
use trust_dns_proto::rr::rdata::mx::MX;
789+
use trust_dns_proto::rr::rdata::name::ANAME;
790+
use trust_dns_proto::rr::rdata::name::CNAME;
791+
use trust_dns_proto::rr::rdata::name::NS;
792+
use trust_dns_proto::rr::rdata::name::PTR;
787793
use trust_dns_proto::rr::rdata::naptr::NAPTR;
788794
use trust_dns_proto::rr::rdata::srv::SRV;
789795
use trust_dns_proto::rr::rdata::txt::TXT;
@@ -794,7 +800,7 @@ mod tests {
794800
#[test]
795801
fn rdata_to_return_record_a() {
796802
let func = rdata_to_return_record(RecordType::A);
797-
let rdata = RData::A(Ipv4Addr::new(127, 0, 0, 1));
803+
let rdata = RData::A(A(Ipv4Addr::new(127, 0, 0, 1)));
798804
assert_eq!(
799805
func(&rdata).unwrap(),
800806
Some(DnsReturnRecord::A("127.0.0.1".to_string()))
@@ -804,7 +810,7 @@ mod tests {
804810
#[test]
805811
fn rdata_to_return_record_aaaa() {
806812
let func = rdata_to_return_record(RecordType::AAAA);
807-
let rdata = RData::AAAA(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
813+
let rdata = RData::AAAA(AAAA(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)));
808814
assert_eq!(
809815
func(&rdata).unwrap(),
810816
Some(DnsReturnRecord::Aaaa("::1".to_string()))
@@ -814,7 +820,7 @@ mod tests {
814820
#[test]
815821
fn rdata_to_return_record_aname() {
816822
let func = rdata_to_return_record(RecordType::ANAME);
817-
let rdata = RData::ANAME(Name::new());
823+
let rdata = RData::ANAME(ANAME(Name::new()));
818824
assert_eq!(
819825
func(&rdata).unwrap(),
820826
Some(DnsReturnRecord::Aname("".to_string()))
@@ -842,7 +848,7 @@ mod tests {
842848
#[test]
843849
fn rdata_to_return_record_cname() {
844850
let func = rdata_to_return_record(RecordType::CNAME);
845-
let rdata = RData::CNAME(Name::new());
851+
let rdata = RData::CNAME(CNAME(Name::new()));
846852
assert_eq!(
847853
func(&rdata).unwrap(),
848854
Some(DnsReturnRecord::Cname("".to_string()))
@@ -889,7 +895,7 @@ mod tests {
889895
#[test]
890896
fn rdata_to_return_record_ns() {
891897
let func = rdata_to_return_record(RecordType::NS);
892-
let rdata = RData::NS(Name::new());
898+
let rdata = RData::NS(NS(Name::new()));
893899
assert_eq!(
894900
func(&rdata).unwrap(),
895901
Some(DnsReturnRecord::Ns("".to_string()))
@@ -899,7 +905,7 @@ mod tests {
899905
#[test]
900906
fn rdata_to_return_record_ptr() {
901907
let func = rdata_to_return_record(RecordType::PTR);
902-
let rdata = RData::PTR(Name::new());
908+
let rdata = RData::PTR(PTR(Name::new()));
903909
assert_eq!(
904910
func(&rdata).unwrap(),
905911
Some(DnsReturnRecord::Ptr("".to_string()))

tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ serde.workspace = true
5757
test_util.workspace = true
5858
tokio.workspace = true
5959
tower-lsp.workspace = true
60-
trust-dns-client = "=0.22.0"
61-
trust-dns-server = "=0.22.1"
60+
trust-dns-client = "=0.23.2"
61+
trust-dns-server = "=0.23.2"
6262
url.workspace = true
6363
uuid = { workspace = true, features = ["serde"] }
6464
zeromq.workspace = true

tests/integration/run_tests.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4011,11 +4011,8 @@ async fn test_resolve_dns() {
40114011
)
40124012
.unwrap();
40134013
let lexer = Lexer::new(&zone_file);
4014-
let records = Parser::new().parse(
4015-
lexer,
4016-
Some(Name::from_str("example.com").unwrap()),
4017-
None,
4018-
);
4014+
let records =
4015+
Parser::new().parse(lexer, Some(Name::from_str("example.com").unwrap()));
40194016
if records.is_err() {
40204017
panic!("failed to parse: {:?}", records.err())
40214018
}

0 commit comments

Comments
 (0)