From c0aaae3856b3e8bcc4cbca3cc0242cf23d7f8211 Mon Sep 17 00:00:00 2001 From: Alison Tong <28715175+AlisonT1230@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:19:13 -0400 Subject: [PATCH 1/2] remove hickory specific fn --- Cargo.toml | 4 ++-- src/lib.rs | 14 ++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2c1b263..ce7da24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,5 +20,5 @@ categories = ["network-programming", "data-structures"] # be separated with a `/` license = "MIT" -[dependencies] -hickory-proto = { version = "0.25.1", features = ["dnssec-ring"] } +[dev-dependencies] +hickory-proto = { version = "0.26.0", features = ["dnssec-ring"] } diff --git a/src/lib.rs b/src/lib.rs index 224b572..869baca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,16 +172,6 @@ impl List { pub fn parse_dns_name(&self, domain: &str) -> io::Result { DnsName::parse(domain, self) } - - /// Converts a TrustDNS [`Name`] into a `DnsName` - /// - /// [`Name`]: trust_dns_proto::rr::domain::Name - pub fn from_trustdns_name( - &self, - name: &hickory_proto::rr::domain::Name, - ) -> io::Result { - self.parse_dns_name(&name.to_ascii()) - } } impl std::str::FromStr for List { @@ -424,14 +414,14 @@ mod unit_tests { use std::str::FromStr; let list = List::from_path("suffix-list.txt").unwrap(); - let domain = list.from_trustdns_name(&Name::from_str("a.b.c").unwrap())?; + let domain = list.parse_dns_name(&Name::from_str("a.b.c").unwrap().to_ascii())?; assert_eq!(domain.name(), "a.b.c"); assert_eq!(domain.rname(), "c.b.a"); assert_eq!(domain.root(), Some("b.c")); assert_eq!(domain.suffix(), Some("c")); // conversion to ascii - let domain = list.from_trustdns_name(&Name::from_str("a.♥").unwrap())?; + let domain = list.parse_dns_name(&Name::from_str("a.♥").unwrap().to_ascii())?; assert_eq!(domain.name(), "a.xn--g6h"); assert_eq!(domain.root(), Some("a.xn--g6h")); assert_eq!(domain.suffix(), Some("xn--g6h")); From a6120aa155c261a4ae47f07ae06d524740d7eaa1 Mon Sep 17 00:00:00 2001 From: Alison Tong <28715175+AlisonT1230@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:38:48 -0400 Subject: [PATCH 2/2] inc major --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ce7da24..0db714f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "dns_name" authors = ["BlueCat Networks "] description = "DNS name parsing with public suffix lookup" -version = "2.0.0" +version = "3.0.0" edition = "2021" # These URLs point to more information about the repository documentation = "https://docs.rs/dns_name"