diff --git a/core/lib.rs b/core/lib.rs index 46a479a54..44a802db9 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -1971,7 +1971,7 @@ impl Connection { } pub fn get_encryption_cipher_mode(&self) -> Option { - self.encryption_cipher.borrow().clone() + *self.encryption_cipher.borrow() } // if both key and cipher are set, set encryption context on pager @@ -1980,7 +1980,7 @@ impl Connection { let Some(key) = key_ref.as_ref() else { return; }; - let Some(cipher) = self.encryption_cipher.borrow().clone() else { + let Some(cipher) = *self.encryption_cipher.borrow() else { return; }; tracing::trace!("setting encryption ctx for connection"); diff --git a/core/storage/encryption.rs b/core/storage/encryption.rs index 17343f1c0..51cf84ee5 100644 --- a/core/storage/encryption.rs +++ b/core/storage/encryption.rs @@ -21,7 +21,7 @@ impl EncryptionKey { pub fn from_hex_string(s: &str) -> Result { let hex_str = s.trim(); let bytes = hex::decode(hex_str) - .map_err(|e| LimboError::InvalidArgument(format!("Invalid hex string: {}", e)))?; + .map_err(|e| LimboError::InvalidArgument(format!("Invalid hex string: {e}")))?; let key: [u8; 32] = bytes.try_into().map_err(|v: Vec| { LimboError::InvalidArgument(format!( "Hex string must decode to exactly 32 bytes, got {}", @@ -142,8 +142,7 @@ impl TryFrom<&str> for CipherMode { "aes256gcm" | "aes-256-gcm" | "aes_256_gcm" => Ok(CipherMode::Aes256Gcm), "aegis256" | "aegis-256" | "aegis_256" => Ok(CipherMode::Aegis256), _ => Err(LimboError::InvalidArgument(format!( - "Unknown cipher name: {}", - s + "Unknown cipher name: {s}" ))), } }