aboutsummaryrefslogtreecommitdiff
path: root/src/db/payments.rs
diff options
context:
space:
mode:
authorJoris2023-04-17 21:10:48 +0200
committerJoris2023-04-17 21:10:48 +0200
commit459016e70dd4933a8082d27748097de81a3e53ff (patch)
tree0ed14ecc8762d62a55bf8c05356bcc984b1a0cea /src/db/payments.rs
parent3932daa26360d6e03807381d0b8ffa2d0e704847 (diff)
Follow clippy indications
Diffstat (limited to 'src/db/payments.rs')
-rw-r--r--src/db/payments.rs11
1 files changed, 4 insertions, 7 deletions
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),
}
}