diff options
author | Joris | 2023-04-17 21:10:48 +0200 |
---|---|---|
committer | Joris | 2023-04-17 21:10:48 +0200 |
commit | 459016e70dd4933a8082d27748097de81a3e53ff (patch) | |
tree | 0ed14ecc8762d62a55bf8c05356bcc984b1a0cea /src/db | |
parent | 3932daa26360d6e03807381d0b8ffa2d0e704847 (diff) |
Follow clippy indications
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/incomes.rs | 4 | ||||
-rw-r--r-- | src/db/jobs.rs | 7 | ||||
-rw-r--r-- | src/db/payments.rs | 11 |
3 files changed, 8 insertions, 14 deletions
diff --git a/src/db/incomes.rs b/src/db/incomes.rs index 2952d62..e5c3164 100644 --- a/src/db/incomes.rs +++ b/src/db/incomes.rs @@ -18,7 +18,7 @@ WHERE incomes.deleted_at IS NULL "#; - let res = sqlx::query(&query) + let res = sqlx::query(query) .map(|row: SqliteRow| row.get("count")) .fetch_one(pool) .await; @@ -169,7 +169,7 @@ WHERE AND deleted_at IS NULL "#; - let res = sqlx::query(&query) + let res = sqlx::query(query) .bind(user_id) .bind(date) .map(|row: SqliteRow| row.get("id")) diff --git a/src/db/jobs.rs b/src/db/jobs.rs index 88c2005..3f84fc8 100644 --- a/src/db/jobs.rs +++ b/src/db/jobs.rs @@ -34,7 +34,7 @@ WHERE } } -pub async fn actualize_last_execution(pool: &SqlitePool, job: Job) -> () { +pub async fn actualize_last_execution(pool: &SqlitePool, job: Job) { let query = r#" UPDATE jobs @@ -48,9 +48,6 @@ WHERE match res { Ok(_) => (), - Err(err) => { - error!("Error actualizing job last execution: {:?}", err); - () - } + Err(err) => error!("Error actualizing job last execution: {:?}", err), } } diff --git a/src/db/payments.rs b/src/db/payments.rs index 0082736..bebc69d 100644 --- a/src/db/payments.rs +++ b/src/db/payments.rs @@ -515,7 +515,7 @@ LIMIT 1 "#; - let res = sqlx::query(&query).bind(category_id).fetch_one(pool).await; + let res = sqlx::query(query).bind(category_id).fetch_one(pool).await; match res { Ok(_) => true, @@ -552,7 +552,7 @@ LEFT OUTER JOIN ( ON users.id = payments.user_id"#; - let res = sqlx::query(&query) + let res = sqlx::query(query) .map(|row: SqliteRow| (row.get("user_id"), row.get("sum"))) .fetch_all(pool) .await; @@ -566,7 +566,7 @@ ON } } -pub async fn create_monthly_payments(pool: &SqlitePool) -> () { +pub async fn create_monthly_payments(pool: &SqlitePool) { let query = r#" INSERT INTO payments(name, cost, user_id, category_id, date, frequency) @@ -588,10 +588,7 @@ WHERE match res { Ok(_) => (), - Err(err) => { - error!("Error creating monthly payments: {:?}", err); - () - } + Err(err) => error!("Error creating monthly payments: {:?}", err), } } |