Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Sep 8, 2023
1 parent eaa7bc0 commit f3a14d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion fang/src/asynk/async_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl AsyncQueue {
scheduled_at: &DateTime<Utc>,
) -> Result<Task, AsyncQueueError> {
let query_params = QueryParams::builder()
.metadata(&metadata)
.metadata(metadata)
.task_type(task_type)
.scheduled_at(scheduled_at)
.build();
Expand Down
34 changes: 17 additions & 17 deletions fang/src/asynk/backend_sqlx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ pub(crate) struct QueryParams<'a> {
}

pub(crate) enum Res {
BIGINT(u64),
Bigint(u64),
Task(Task),
}

impl Res {
pub(crate) fn unwrap_u64(self) -> u64 {
match self {
Res::BIGINT(val) => val,
Res::Bigint(val) => val,
_ => panic!("Can not unwrap a u64"),
}
}
Expand Down Expand Up @@ -208,7 +208,7 @@ impl BackendSqlXPg {
general_any_impl_remove_all_task(REMOVE_ALL_TASK_QUERY_POSTGRES, transaction)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveAllScheduledTask => {
let affected_rows = general_any_impl_remove_all_scheduled_tasks(
Expand All @@ -217,14 +217,14 @@ impl BackendSqlXPg {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTask => {
let affected_rows =
general_any_impl_remove_task(REMOVE_TASK_QUERY_POSTGRES, transaction, params)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTaskByMetadata => {
let affected_rows = general_any_impl_remove_task_by_metadata(
Expand All @@ -234,7 +234,7 @@ impl BackendSqlXPg {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTaskType => {
let affected_rows = general_any_impl_remove_task_type(
Expand All @@ -244,7 +244,7 @@ impl BackendSqlXPg {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::FetchTaskType => {
let task = general_any_impl_fetch_task_type(
Expand Down Expand Up @@ -329,7 +329,7 @@ impl BackendSqlXSQLite {
general_any_impl_remove_all_task(REMOVE_ALL_TASK_QUERY_SQLITE, transaction)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveAllScheduledTask => {
let affected_rows = general_any_impl_remove_all_scheduled_tasks(
Expand All @@ -338,14 +338,14 @@ impl BackendSqlXSQLite {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTask => {
let affected_rows =
general_any_impl_remove_task(REMOVE_TASK_QUERY_SQLITE, transaction, params)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTaskByMetadata => {
let affected_rows = general_any_impl_remove_task_by_metadata(
Expand All @@ -355,7 +355,7 @@ impl BackendSqlXSQLite {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTaskType => {
let affected_rows = general_any_impl_remove_task_type(
Expand All @@ -365,7 +365,7 @@ impl BackendSqlXSQLite {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::FetchTaskType => {
let task = general_any_impl_fetch_task_type(
Expand Down Expand Up @@ -742,7 +742,7 @@ impl BackendSqlXMySQL {
general_any_impl_remove_all_task(REMOVE_ALL_TASK_QUERY_MYSQL, transaction)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}

Q::RemoveAllScheduledTask => {
Expand All @@ -752,15 +752,15 @@ impl BackendSqlXMySQL {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}

Q::RemoveTask => {
let affected_rows =
general_any_impl_remove_task(REMOVE_TASK_QUERY_MYSQL, transaction, params)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTaskByMetadata => {
let affected_rows = general_any_impl_remove_task_by_metadata(
Expand All @@ -770,7 +770,7 @@ impl BackendSqlXMySQL {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::RemoveTaskType => {
let affected_rows = general_any_impl_remove_task_type(
Expand All @@ -780,7 +780,7 @@ impl BackendSqlXMySQL {
)
.await?;

Ok(Res::BIGINT(affected_rows))
Ok(Res::Bigint(affected_rows))
}
Q::FetchTaskType => {
let task = general_any_impl_fetch_task_type(
Expand Down

0 comments on commit f3a14d4

Please sign in to comment.