aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/incomes.rs4
-rw-r--r--src/db/jobs.rs7
-rw-r--r--src/db/payments.rs11
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),
}
}