🧑‍💻 Passes fmt and clippy checks

This commit is contained in:
Manuel Cillero 2023-11-03 23:15:00 +01:00
parent 0397036d95
commit 7c9b08752a
2 changed files with 12 additions and 4 deletions

View file

@ -4,8 +4,10 @@ use crate::{Handle, LazyStatic};
use std::collections::HashMap;
use std::sync::RwLock;
type KeyHandles = (Handle, Option<Handle>);
// Registered actions.
static ACTIONS: LazyStatic<RwLock<HashMap<(Handle, Option<Handle>), ActionsList>>> =
static ACTIONS: LazyStatic<RwLock<HashMap<KeyHandles, ActionsList>>> =
LazyStatic::new(|| RwLock::new(HashMap::new()));
pub fn add_action(action: Action) {

View file

@ -93,7 +93,9 @@ pub async fn query<Q: QueryStatementWriter>(stmt: &mut Q) -> Result<Vec<QueryRes
))
.await
}
None => 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<Q: QueryStatementWriter>(stmt: &mut Q) -> Result<Option<QueryR
))
.await
}
None => 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<ExecResult, DbErr> {
.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(),
))),
}
}