diff --git a/pagetop/src/core/action/all.rs b/pagetop/src/core/action/all.rs index c42e1bee..66d0e1d4 100644 --- a/pagetop/src/core/action/all.rs +++ b/pagetop/src/core/action/all.rs @@ -4,8 +4,10 @@ use crate::{Handle, LazyStatic}; use std::collections::HashMap; use std::sync::RwLock; +type KeyHandles = (Handle, Option); + // Registered actions. -static ACTIONS: LazyStatic), ActionsList>>> = +static ACTIONS: LazyStatic>> = LazyStatic::new(|| RwLock::new(HashMap::new())); pub fn add_action(action: Action) { diff --git a/pagetop/src/db.rs b/pagetop/src/db.rs index aac2e073..fb652c11 100644 --- a/pagetop/src/db.rs +++ b/pagetop/src/db.rs @@ -93,7 +93,9 @@ pub async fn query(stmt: &mut Q) -> Result Err(DbErr::Conn(RuntimeErr::Internal(DBCONN_NOT_INITIALIZED.to_owned()))), + None => Err(DbErr::Conn(RuntimeErr::Internal( + DBCONN_NOT_INITIALIZED.to_owned(), + ))), } } @@ -112,7 +114,9 @@ pub async fn exec(stmt: &mut Q) -> Result Err(DbErr::Conn(RuntimeErr::Internal(DBCONN_NOT_INITIALIZED.to_owned()))), + None => Err(DbErr::Conn(RuntimeErr::Internal( + DBCONN_NOT_INITIALIZED.to_owned(), + ))), } } @@ -124,7 +128,9 @@ pub async fn exec_raw(stmt: String) -> Result { .execute(Statement::from_string(dbbackend, stmt)) .await } - None => Err(DbErr::Conn(RuntimeErr::Internal(DBCONN_NOT_INITIALIZED.to_owned()))), + None => Err(DbErr::Conn(RuntimeErr::Internal( + DBCONN_NOT_INITIALIZED.to_owned(), + ))), } }