Fix clippy boss' complaints

This commit is contained in:
Avinash Sajjanshetty
2025-08-25 16:51:19 +05:30
parent cf7418663c
commit b85ba09014
2 changed files with 4 additions and 5 deletions

View File

@@ -1971,7 +1971,7 @@ impl Connection {
}
pub fn get_encryption_cipher_mode(&self) -> Option<CipherMode> {
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");

View File

@@ -21,7 +21,7 @@ impl EncryptionKey {
pub fn from_hex_string(s: &str) -> Result<Self> {
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<u8>| {
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}"
))),
}
}