Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Nov 21, 2024
1 parent 0749556 commit 30893ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions aws-lc-rs/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ impl TestCase {
}
}
Some(b'"') => {
if s.next().is_some() {
panic!("characters after the closing quote of a quoted string.");
}
assert!(
s.next().is_none(),
"characters after the closing quote of a quoted string."
);
break;
}
Some(b) => *b,
Expand All @@ -233,7 +234,7 @@ impl TestCase {
match from_hex(&s) {
Ok(s) => s,
Err(err_str) => {
panic!("{} in {}", err_str, s);
panic!("{err_str} in {s}");
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-rs/tests/aead_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ fn test_aead<Seal, Open>(
assert_eq!(Err(error::Unspecified), o_result);
}
Some(error) => {
panic!("Unexpected error test case: {}", error);
panic!("Unexpected error test case: {error}");
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions aws-lc-rs/tests/ecdsa_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ fn ecdsa_from_pkcs8_test() {
match (EcdsaKeyPair::from_pkcs8(this_asn1, &input), error) {
(Ok(_), None) => (),
(Err(e), None) => {
panic!("Failed with error \"{}\", but expected to succeed", e);
panic!("Failed with error \"{e}\", but expected to succeed");
}
(Ok(_), Some(e)) => panic!("Succeeded, but expected error \"{}\"", e),
(Ok(_), Some(e)) => panic!("Succeeded, but expected error \"{e}\""),
(Err(actual), Some(expected)) => assert_eq!(format!("{actual}"), expected),
};

Expand Down Expand Up @@ -229,7 +229,7 @@ fn test_signature_ecdsa_verify_fixed(data_file: test::File) {
("secp256k1", "SHA256") => &signature::ECDSA_P256K1_SHA256_FIXED,
("secp256k1", "SHA3-256") => &signature::ECDSA_P256K1_SHA3_256_FIXED,
_ => {
panic!("Unsupported curve+digest: {}+{}", curve_name, digest_name);
panic!("Unsupported curve+digest: {curve_name}+{digest_name}");
}
};

Expand Down

0 comments on commit 30893ba

Please sign in to comment.