Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
1.52 is out
  • Loading branch information
trinity-1686a authored and bluejekyll committed May 9, 2021
1 parent 6c672f2 commit 31c748d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bin/src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ impl<'a> From<ArgMatches<'a>> 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")),
}
}
}
Expand Down
21 changes: 17 additions & 4 deletions bin/tests/server_harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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...") {
Expand Down
2 changes: 1 addition & 1 deletion crates/client/src/serialize/txt/rdata_parsers/tlsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::rr::rdata::tlsa::CertUsage;
use crate::rr::rdata::{sshfp, TLSA};

fn to_u8(data: &str) -> ParseResult<u8> {
data.parse::<u8>().map_err(ParseError::from)
data.parse().map_err(ParseError::from)
}

/// Parse the RData from a set of Tokens
Expand Down

0 comments on commit 31c748d

Please # to comment.