use diesel_async::RunQueryDsl;
impl CaptchaAnswer {
- pub async fn insert(pool: &DbPool, captcha: &CaptchaAnswerForm) -> Result<Self, Error> {
+ pub async fn insert(pool: &mut DbPool<'_>, captcha: &CaptchaAnswerForm) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?;
insert_into(captcha_answer)
.await
}
- pub async fn check_captcha(pool: &DbPool, to_check: CheckCaptchaAnswer) -> Result<bool, Error> {
+ pub async fn check_captcha(
+ pool: &mut DbPool<'_>,
+ to_check: CheckCaptchaAnswer,
+ ) -> Result<bool, Error> {
let conn = &mut get_conn(pool).await?;
// fetch requested captcha
#[serial]
async fn test_captcha_happy_path() {
let pool = &build_db_pool_for_tests().await;
+ let pool = &mut pool.into();
let inserted = CaptchaAnswer::insert(
pool,
#[serial]
async fn test_captcha_repeat_answer_fails() {
let pool = &build_db_pool_for_tests().await;
+ let pool = &mut pool.into();
let inserted = CaptchaAnswer::insert(
pool,