Skip to content

Commit 5b76d00

Browse files
committed
Address new nightly clippy lints
1 parent 7c4a882 commit 5b76d00

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

webpki-ccadb/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl CertificateMetadata {
188188
date if date.is_empty() => None,
189189
date => Some(
190190
NaiveDate::parse_from_str(date, "%Y.%m.%d")
191-
.unwrap_or_else(|_| panic!("invalid distrust for tls after date: {:?}", date)),
191+
.unwrap_or_else(|_| panic!("invalid distrust for tls after date: {date:?}")),
192192
),
193193
}
194194
}
@@ -260,7 +260,7 @@ impl From<&str> for TrustBits {
260260
"Websites" => TrustBits::Websites,
261261
"Email" => TrustBits::Email,
262262
"Code" => TrustBits::Code,
263-
val => panic!("unknown trust bit: {:?}", val),
263+
val => panic!("unknown trust bit: {val:?}"),
264264
}
265265
}
266266
}

webpki-root-certs/tests/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async fn new_generated_code_is_fresh() {
2222

2323
write!(&mut encoded_cert_der, "b\"").unwrap();
2424
for &b in root.der().as_ref() {
25-
encoded_cert_der.push_str(&format!("\\x{:02X}", b));
25+
encoded_cert_der.push_str(&format!("\\x{b:02X}"));
2626
}
2727
encoded_cert_der.push('"');
2828

webpki-roots/tests/codegen.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ async fn new_generated_code_is_fresh() {
5454

5555
// Write comment
5656
code.push_str(" /*\n");
57-
code.push_str(&format!(" * Issuer: {}\n", issuer));
58-
code.push_str(&format!(" * Subject: {}\n", subject_str));
59-
code.push_str(&format!(" * Label: {:?}\n", label));
60-
code.push_str(&format!(" * Serial: {}\n", serial));
61-
code.push_str(&format!(" * SHA256 Fingerprint: {}\n", sha256_fp));
57+
code.push_str(&format!(" * Issuer: {issuer}\n"));
58+
code.push_str(&format!(" * Subject: {subject_str}\n"));
59+
code.push_str(&format!(" * Label: {label:?}\n"));
60+
code.push_str(&format!(" * Serial: {serial}\n"));
61+
code.push_str(&format!(" * SHA256 Fingerprint: {sha256_fp}\n"));
6262
for ln in root.pem().lines() {
6363
code.push_str(" * ");
6464
code.push_str(ln.trim());
@@ -109,7 +109,7 @@ fn name_to_string(name: &X509Name) -> String {
109109
.next()
110110
.and_then(|cn| cn.as_str().ok())
111111
{
112-
write!(ret, "CN={}", cn).unwrap();
112+
write!(ret, "CN={cn}").unwrap();
113113
}
114114

115115
let mut append_attrs = |attrs: Vec<&AttributeTypeAndValue>, label| {
@@ -122,7 +122,7 @@ fn name_to_string(name: &X509Name) -> String {
122122
if !ret.is_empty() {
123123
ret.push(' ');
124124
}
125-
write!(ret, "{}={}", label, str_parts).unwrap();
125+
write!(ret, "{label}={str_parts}").unwrap();
126126
}
127127
};
128128

webpki-roots/tests/verify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl ConstraintTest {
8383
.iter()
8484
.filter_map(|subtree| match subtree {
8585
rcgen::GeneralSubtree::DnsName(dns_name) => Some(rcgen_ee_for_name(
86-
format!("valid{}{}", dns_name, suffix),
86+
format!("valid{dns_name}{suffix}"),
8787
&trust_anchor,
8888
&key_pair,
8989
)),
@@ -152,7 +152,7 @@ fn rcgen_name_constraints(der: &[u8]) -> rcgen::NameConstraints {
152152
.iter()
153153
.map(|subtree| match &subtree.base {
154154
GeneralName::DNSName(base) => rcgen::GeneralSubtree::DnsName(base.to_string()),
155-
name => panic!("unexpected subtree base general name type: {}", name),
155+
name => panic!("unexpected subtree base general name type: {name}"),
156156
})
157157
.collect(),
158158
};

0 commit comments

Comments
 (0)