mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-22 00:15:20 +01:00
Fix clippy boss' complaints
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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}"
|
||||
))),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user