Use Clippy on test code too (#22)

This commit is contained in:
daxpedda
2021-10-05 15:19:20 -07:00
committed by GitHub
parent a3db6cd9d2
commit 2d8780476a
5 changed files with 25 additions and 41 deletions
+2 -8
View File
@@ -36,10 +36,7 @@ fn test_group_properties() -> Result<(), InternalError> {
fn test_identity_element_error<CS: CipherSuite>() -> Result<(), InternalError> {
let identity = CS::Group::identity();
let result = CS::Group::from_element_slice(&identity.to_arr());
assert!(match result {
Err(InternalError::PointError) => true,
_ => false,
});
assert!(matches!(result, Err(InternalError::PointError)));
Ok(())
}
@@ -48,10 +45,7 @@ fn test_identity_element_error<CS: CipherSuite>() -> Result<(), InternalError> {
fn test_zero_scalar_error<CS: CipherSuite>() -> Result<(), InternalError> {
let zero_scalar = CS::Group::scalar_zero();
let result = CS::Group::from_scalar_slice(&CS::Group::scalar_as_bytes(zero_scalar));
assert!(match result {
Err(InternalError::ZeroScalarError) => true,
_ => false,
});
assert!(matches!(result, Err(InternalError::ZeroScalarError)));
Ok(())
}