Skip to content

Commit

Permalink
fix: Make alg enum exhaustive (#866)
Browse files Browse the repository at this point in the history
* fix: Make alg enum exhaustive again

* fix: update tests with exhaustive checks
  • Loading branch information
tmathern authored Jan 22, 2025
1 parent 06fc905 commit 0466948
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions cawg_identity/src/tests/fixtures/test_credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ pub(crate) fn cert_chain_and_private_key_for_alg(alg: SigningAlg) -> (Vec<u8>, V
include_bytes!("../../../../sdk/tests/fixtures/certs/ed25519.pub").to_vec(),
include_bytes!("../../../../sdk/tests/fixtures/certs/ed25519.pem").to_vec(),
),

_ => unimplemented!("Unknown SigningAlg variant {alg:#?}"),
}
}
1 change: 0 additions & 1 deletion internal/crypto/src/raw_signature/signing_alg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use serde::{Deserialize, Serialize};
/// [§13.2, “Digital Signatures”]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_digital_signatures
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "json_schema", derive(JsonSchema))]
#[non_exhaustive]
pub enum SigningAlg {
/// ECDSA with SHA-256
Es256,
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/utils/test_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ fn cert_chain_and_private_key_for_alg(alg: SigningAlg) -> (Vec<u8>, Vec<u8>) {
include_bytes!("../../tests/fixtures/certs/ed25519.pub").to_vec(),
include_bytes!("../../tests/fixtures/certs/ed25519.pem").to_vec(),
),

_ => unimplemented!("Unknown SigningAlg variant {alg:#?}"),
}
}

Expand Down

0 comments on commit 0466948

Please sign in to comment.