🧑💻 Passes fmt and clippy checks
This commit is contained in:
parent
0397036d95
commit
7c9b08752a
2 changed files with 12 additions and 4 deletions
|
|
@ -4,8 +4,10 @@ use crate::{Handle, LazyStatic};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
|
|
||||||
|
type KeyHandles = (Handle, Option<Handle>);
|
||||||
|
|
||||||
// Registered actions.
|
// Registered actions.
|
||||||
static ACTIONS: LazyStatic<RwLock<HashMap<(Handle, Option<Handle>), ActionsList>>> =
|
static ACTIONS: LazyStatic<RwLock<HashMap<KeyHandles, ActionsList>>> =
|
||||||
LazyStatic::new(|| RwLock::new(HashMap::new()));
|
LazyStatic::new(|| RwLock::new(HashMap::new()));
|
||||||
|
|
||||||
pub fn add_action(action: Action) {
|
pub fn add_action(action: Action) {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,9 @@ pub async fn query<Q: QueryStatementWriter>(stmt: &mut Q) -> Result<Vec<QueryRes
|
||||||
))
|
))
|
||||||
.await
|
.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
|
.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))
|
.execute(Statement::from_string(dbbackend, stmt))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
None => Err(DbErr::Conn(RuntimeErr::Internal(DBCONN_NOT_INITIALIZED.to_owned()))),
|
None => Err(DbErr::Conn(RuntimeErr::Internal(
|
||||||
|
DBCONN_NOT_INITIALIZED.to_owned(),
|
||||||
|
))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue