feat: make clippy happy & update denpendencies

This commit is contained in:
2024-09-03 22:37:32 +08:00
parent 15201b92a5
commit d6c49a15ea
11 changed files with 492 additions and 384 deletions

View File

@@ -1,7 +1,7 @@
use rusqlite::{Connection, params};
use rust_util::{debugging, information, opt_result, simple_error, success, XResult};
pub const DEFAULT_MASTER_KEY_VERIFICATION_KEY: &'static str = "__master_verification_key";
pub const DEFAULT_MASTER_KEY_VERIFICATION_KEY: &str = "__master_verification_key";
pub struct Key {
pub name: String,
@@ -44,7 +44,7 @@ pub fn insert_key(conn: &Connection, key: &Key) -> XResult<()> {
let default_comment = "".to_string();
let _ = conn.execute(
"INSERT INTO keys (name, value, comment) VALUES (?1, ?2, ?3)",
(&key.name, &key.encrypted_key, key.comment.as_ref().unwrap_or_else(|| &default_comment)),
(&key.name, &key.encrypted_key, key.comment.as_ref().unwrap_or(&default_comment)),
)?;
Ok(())
}