Skip to content

Commit

Permalink
I think this may be a Rust compiler issue, but I fixed it so I will t…
Browse files Browse the repository at this point in the history
…ake it
  • Loading branch information
pxp9 committed Apr 15, 2024
1 parent 670405a commit e3d942b
Showing 1 changed file with 41 additions and 12 deletions.
53 changes: 41 additions & 12 deletions fang/src/asynk/backend_sqlx/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ impl FangQueryable<MySql> for BackendSqlXMySQL {

let query_params = QueryParams::builder().uuid(&uuid).build();

let task: Task =
Self::find_task_by_id(FIND_TASK_BY_ID_QUERY_MYSQL, pool, query_params).await?;
let task: Task = <BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_id(
FIND_TASK_BY_ID_QUERY_MYSQL,
pool,
query_params,
)
.await?;

Ok(task)
}
Expand Down Expand Up @@ -169,8 +173,12 @@ impl FangQueryable<MySql> for BackendSqlXMySQL {

let query_params = QueryParams::builder().uuid(params.uuid.unwrap()).build();

let task: Task =
Self::find_task_by_id(FIND_TASK_BY_ID_QUERY_MYSQL, pool, query_params).await?;
let task: Task = <BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_id(
FIND_TASK_BY_ID_QUERY_MYSQL,
pool,
query_params,
)
.await?;

Ok(task)
}
Expand Down Expand Up @@ -214,8 +222,12 @@ impl FangQueryable<MySql> for BackendSqlXMySQL {

let query_params = QueryParams::builder().uuid(&uuid).build();

let task: Task =
Self::find_task_by_id(FIND_TASK_BY_ID_QUERY_MYSQL, pool, query_params).await?;
let task: Task = <BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_id(
FIND_TASK_BY_ID_QUERY_MYSQL,
pool,
query_params,
)
.await?;

Ok(task)
}
Expand Down Expand Up @@ -254,8 +266,12 @@ impl FangQueryable<MySql> for BackendSqlXMySQL {

let query_params = QueryParams::builder().uuid(&id).build();

let failed_task: Task =
Self::find_task_by_id(FIND_TASK_BY_ID_QUERY_MYSQL, pool, query_params).await?;
let failed_task: Task = <BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_id(
FIND_TASK_BY_ID_QUERY_MYSQL,
pool,
query_params,
)
.await?;

Ok(failed_task)
}
Expand Down Expand Up @@ -300,8 +316,12 @@ impl FangQueryable<MySql> for BackendSqlXMySQL {

let query_params = QueryParams::builder().uuid(&uuid).build();

let failed_task: Task =
Self::find_task_by_id(FIND_TASK_BY_ID_QUERY_MYSQL, pool, query_params).await?;
let failed_task: Task = <BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_id(
FIND_TASK_BY_ID_QUERY_MYSQL,
pool,
query_params,
)
.await?;

Ok(failed_task)
}
Expand All @@ -311,9 +331,18 @@ impl FangQueryable<MySql> for BackendSqlXMySQL {
pool: &Pool<MySql>,
params: QueryParams<'_>,
) -> Result<Task, AsyncQueueError> {
match Self::find_task_by_uniq_hash(queries.0, pool, &params).await {
match <BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_uniq_hash(
queries.0, pool, &params,
)
.await
{
Some(task) => Ok(task),
None => Self::insert_task_uniq(queries.1, pool, params).await,
None => {
<BackendSqlXMySQL as FangQueryable<MySql>>::insert_task_uniq(
queries.1, pool, params,
)
.await
}
}
}

Expand Down

0 comments on commit e3d942b

Please sign in to comment.