diff --git a/bin/src/named.rs b/bin/src/named.rs index bee50e5fe8..2052c914cb 100644 --- a/bin/src/named.rs +++ b/bin/src/named.rs @@ -267,13 +267,13 @@ impl<'a> From> for Args { flag_zonedir: matches.value_of(ZONEDIR_ARG).map(ToString::to_string), flag_port: matches .value_of(PORT_ARG) - .map(|s| u16::from_str_radix(s, 10).expect("bad port argument")), + .map(|s| s.parse().expect("bad port argument")), flag_tls_port: matches .value_of(TLS_PORT_ARG) - .map(|s| u16::from_str_radix(s, 10).expect("bad tls-port argument")), + .map(|s| s.parse().expect("bad tls-port argument")), flag_https_port: matches .value_of(HTTPS_PORT_ARG) - .map(|s| u16::from_str_radix(s, 10).expect("bad https-port argument")), + .map(|s| s.parse().expect("bad https-port argument")), } } } diff --git a/bin/tests/server_harness/mod.rs b/bin/tests/server_harness/mod.rs index bd4b087447..e36fdad0f7 100644 --- a/bin/tests/server_harness/mod.rs +++ b/bin/tests/server_harness/mod.rs @@ -130,22 +130,35 @@ where if let Some(udp) = udp_regex.captures(&output) { test_udp_port = Some( - u16::from_str_radix(udp.get(1).expect("udp missing port").as_str(), 10) + udp.get(1) + .expect("udp missing port") + .as_str() + .parse() .expect("could not parse udp port"), ); } else if let Some(tcp) = tcp_regex.captures(&output) { test_tcp_port = Some( - u16::from_str_radix(tcp.get(1).expect("tcp missing port").as_str(), 10) + tcp.get(1) + .expect("tcp missing port") + .as_str() + .parse() .expect("could not parse tcp port"), ); } else if let Some(tls) = tls_regex.captures(&output) { test_tls_port = Some( - u16::from_str_radix(tls.get(1).expect("tls missing port").as_str(), 10) + tls.get(1) + .expect("tls missing port") + .as_str() + .parse() .expect("could not parse tls port"), ); } else if let Some(https) = https_regex.captures(&output) { test_https_port = Some( - u16::from_str_radix(https.get(1).expect("https missing port").as_str(), 10) + https + .get(1) + .expect("https missing port") + .as_str() + .parse() .expect("could not parse https port"), ); } else if output.contains("awaiting connections...") { diff --git a/crates/client/src/serialize/txt/rdata_parsers/tlsa.rs b/crates/client/src/serialize/txt/rdata_parsers/tlsa.rs index 689e301a41..319b214386 100644 --- a/crates/client/src/serialize/txt/rdata_parsers/tlsa.rs +++ b/crates/client/src/serialize/txt/rdata_parsers/tlsa.rs @@ -13,7 +13,7 @@ use crate::rr::rdata::tlsa::CertUsage; use crate::rr::rdata::{sshfp, TLSA}; fn to_u8(data: &str) -> ParseResult { - data.parse::().map_err(ParseError::from) + data.parse().map_err(ParseError::from) } /// Parse the RData from a set of Tokens