From 46582d5bfef32c2a64aaf0ac35ba35cac901291b Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sun, 12 Jan 2025 16:31:08 +0000 Subject: [PATCH] cargo clippy --- kms/src/onboard_service.rs | 2 +- ra-rpc/src/client.rs | 2 +- ra-tls/src/cert.rs | 6 +++--- tappd/src/rpc_service.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kms/src/onboard_service.rs b/kms/src/onboard_service.rs index 3cc4298..eb0cc73 100644 --- a/kms/src/onboard_service.rs +++ b/kms/src/onboard_service.rs @@ -199,7 +199,7 @@ impl Keys { pub(crate) fn bootstrap_keys(cfg: &KmsConfig) -> Result<()> { let keys = Keys::generate("kms.localhost").context("Failed to generate keys")?; - keys.store(&cfg)?; + keys.store(cfg)?; Ok(()) } diff --git a/ra-rpc/src/client.rs b/ra-rpc/src/client.rs index 05e438e..b19e5d4 100644 --- a/ra-rpc/src/client.rs +++ b/ra-rpc/src/client.rs @@ -109,7 +109,7 @@ impl RaClient { }; let verified_attestation = attestation - .verify_with_ra_pubkey(&cert.public_key().raw, self.pccs_url.as_deref()) + .verify_with_ra_pubkey(cert.public_key().raw, self.pccs_url.as_deref()) .await .context("Failed to verify the attestation report")?; diff --git a/ra-tls/src/cert.rs b/ra-tls/src/cert.rs index c96f386..a03c348 100644 --- a/ra-tls/src/cert.rs +++ b/ra-tls/src/cert.rs @@ -181,7 +181,7 @@ pub struct CertRequest<'a, Key> { usage_client_auth: bool, } -impl<'a, Key> CertRequest<'a, Key> { +impl CertRequest<'_, Key> { fn into_cert_params(self) -> Result { let mut params = CertificateParams::new(vec![])?; let mut dn = DistinguishedName::new(); @@ -247,7 +247,7 @@ impl<'a, Key> CertRequest<'a, Key> { } } -impl<'a> CertRequest<'a, KeyPair> { +impl CertRequest<'_, KeyPair> { /// Create a self-signed certificate. pub fn self_signed(self) -> Result { let key = self.key; @@ -256,7 +256,7 @@ impl<'a> CertRequest<'a, KeyPair> { } } -impl<'a, Key: PublicKeyData> CertRequest<'a, Key> { +impl CertRequest<'_, Key> { /// Create a certificate signed by a given issuer. pub fn signed_by(self, issuer: &Certificate, issuer_key: &KeyPair) -> Result { let key = self.key; diff --git a/tappd/src/rpc_service.rs b/tappd/src/rpc_service.rs index 488710f..9c794f0 100644 --- a/tappd/src/rpc_service.rs +++ b/tappd/src/rpc_service.rs @@ -92,7 +92,7 @@ impl TappdRpc for InternalRpcHandler { } else { &self.state.inner.keys.k256_key }; - let derived_key = derive_ecdsa_key_pair_from_bytes(&seed, &[request.path.as_bytes()]) + let derived_key = derive_ecdsa_key_pair_from_bytes(seed, &[request.path.as_bytes()]) .context("Failed to derive key")?; let config = CertConfig { org_name: None,