Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
Signed-off-by: Firas Ghanmi <fghanmi@redhat.com>
  • Loading branch information
fghanmi committed Sep 9, 2024
1 parent 353dcf2 commit 13bade5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/trust/sigstore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl SigstoreTrustRoot {

// Delete a target from the TrustedRoot by its identifier raw bytes:
// public key for tlogs and ctlogs, cert chain for certificate and timestamp authorities)
pub fn delete_target(&mut self, target_type: Target, identifier: &Vec<u8>) -> Result<()> {
pub fn delete_target(&mut self, target_type: &Target, identifier: &Vec<u8>) -> Result<()> {
match target_type {
Target::CertificateAuthority => {
self.trusted_root.certificate_authorities.retain(|ca| {
Expand Down Expand Up @@ -779,7 +779,7 @@ mod tests {
);

// Delete the CertificateAuthority by cert_chain
let result = trust_root.delete_target(Target::CertificateAuthority, &cert_chain.raw_bytes);
let result = trust_root.delete_target(&Target::CertificateAuthority, &cert_chain.raw_bytes);
assert!(result.is_ok(), "Failed to delete the certificate authority");

// Verify the CertificateAuthority was deleted
Expand Down Expand Up @@ -854,7 +854,7 @@ mod tests {

// Delete the ctlog by public key raw data
let result =
trust_root.delete_target(Target::Ctlog, &public_key.raw_bytes.clone().unwrap());
trust_root.delete_target(&Target::Ctlog, &public_key.raw_bytes.clone().unwrap());
assert!(result.is_ok(), "Failed to delete the Ctlog");

// Verify the ctlog was deleted
Expand Down

0 comments on commit 13bade5

Please sign in to comment.