Skip to content

Commit d7e3764

Browse files
minor fixes to make clippy happy
1 parent a6da62b commit d7e3764

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/dh_kem.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ pub(super) fn derive_key_pair<Crypto: HpkeCrypto>(
8585
}
8686
if ctr == u8::MAX {
8787
// If we get here we lost. This should never happen.
88-
return Err(Error::CryptoLibraryError(format!(
89-
"Unable to generate a valid P256 private key"
90-
)));
88+
return Err(Error::CryptoLibraryError(
89+
"Unable to generate a valid P256 private key".to_string(),
90+
));
9191
}
9292
ctr += 1;
9393
}

src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ pub struct Hpke<Crypto: 'static + HpkeCrypto> {
325325
impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto> {
326326
fn clone(&self) -> Self {
327327
Self {
328-
mode: self.mode.clone(),
329-
kem_id: self.kem_id.clone(),
330-
kdf_id: self.kdf_id.clone(),
331-
aead_id: self.aead_id.clone(),
328+
mode: self.mode,
329+
kem_id: self.kem_id,
330+
kdf_id: self.kdf_id,
331+
aead_id: self.aead_id,
332332
prng: RwLock::new(Crypto::prng()),
333333
}
334334
}
@@ -530,7 +530,7 @@ impl<Crypto: HpkeCrypto> Hpke<Crypto> {
530530
length: usize,
531531
) -> Result<Vec<u8>, HpkeError> {
532532
let context = self.setup_receiver(enc, sk_r, info, psk, psk_id, pk_s)?;
533-
Ok(context.export(exporter_context, length)?)
533+
context.export(exporter_context, length)
534534
}
535535

536536
/// Verify PSKs.
@@ -932,19 +932,19 @@ impl From<hpke_rs_crypto::error::Error> for HpkeError {
932932
hpke_rs_crypto::error::Error::UnknownAeadAlgorithm => HpkeError::UnknownMode,
933933
hpke_rs_crypto::error::Error::CryptoLibraryError(s) => HpkeError::CryptoError(s),
934934
hpke_rs_crypto::error::Error::HpkeInvalidOutputLength => {
935-
HpkeError::CryptoError(format!("Invalid HPKE output length"))
935+
HpkeError::CryptoError("Invalid HPKE output length".to_string())
936936
}
937937
hpke_rs_crypto::error::Error::UnknownKdfAlgorithm => {
938-
HpkeError::CryptoError(format!("Unknown KDF algorithm."))
938+
HpkeError::CryptoError("Unknown KDF algorithm.".to_string())
939939
}
940940
hpke_rs_crypto::error::Error::KemInvalidSecretKey => {
941-
HpkeError::CryptoError(format!("Invalid KEM secret key"))
941+
HpkeError::CryptoError("Invalid KEM secret key".to_string())
942942
}
943943
hpke_rs_crypto::error::Error::KemInvalidPublicKey => {
944-
HpkeError::CryptoError(format!("Invalid KEM public key"))
944+
HpkeError::CryptoError("Invalid KEM public key".to_string())
945945
}
946946
hpke_rs_crypto::error::Error::UnknownKemAlgorithm => {
947-
HpkeError::CryptoError(format!("Unknown KEM algorithm"))
947+
HpkeError::CryptoError("Unknown KEM algorithm".to_string())
948948
}
949949
hpke_rs_crypto::error::Error::InsufficientRandomness => {
950950
HpkeError::InsufficientRandomness

0 commit comments

Comments
 (0)