diff --git a/src/resolv/lookup/srv.rs b/src/resolv/lookup/srv.rs index d3b26e616..aee53b217 100644 --- a/src/resolv/lookup/srv.rs +++ b/src/resolv/lookup/srv.rs @@ -297,7 +297,7 @@ impl SrvItem { srv.priority(), srv.weight(), srv.port(), - srv.target().try_to_dname().unwrap(), + srv.target().to_dname(), ), fallback: false, resolved: None, @@ -306,7 +306,7 @@ impl SrvItem { fn fallback(name: impl ToDname, fallback_port: u16) -> Self { SrvItem { - srv: Srv::new(0, 0, fallback_port, name.try_to_dname().unwrap()), + srv: Srv::new(0, 0, fallback_port, name.to_dname()), fallback: true, resolved: None, } diff --git a/src/tsig/mod.rs b/src/tsig/mod.rs index c2acc8b0f..898ff4df7 100644 --- a/src/tsig/mod.rs +++ b/src/tsig/mod.rs @@ -391,7 +391,7 @@ where algorithm: Algorithm, ) -> Option { // XXX This seems a bit wasteful. - let name = name.try_to_dname().unwrap(); + let name = name.try_to_dname().ok()?; self.get(&(name, algorithm)).cloned() } }