aboutsummaryrefslogtreecommitdiff
path: root/src/db/incomes.rs
diff options
context:
space:
mode:
authorJoris2025-02-06 19:10:54 +0100
committerJoris2025-02-06 19:10:54 +0100
commit2956aa5f5324e4183dbc87f81fbc71fd0f43dbf9 (patch)
tree41673ba3f942367a5548c1f05ef20a5e17bbba79 /src/db/incomes.rs
parentc70e84a1b2aa307363b7b760f9f15b7438b0afba (diff)
Improve String handling
See https://blog.sulami.xyz/posts/string-vs-str/
Diffstat (limited to 'src/db/incomes.rs')
-rw-r--r--src/db/incomes.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db/incomes.rs b/src/db/incomes.rs
index 90282c0..688e9e1 100644
--- a/src/db/incomes.rs
+++ b/src/db/incomes.rs
@@ -373,8 +373,8 @@ fn cumulative_query(from: NaiveDate) -> String {
ON
users.id = incomes.user_id
"#,
- bounded_query(">".to_string(), from.format("%Y-%m-%d").to_string()),
- bounded_query("<".to_string(), "date()".to_string())
+ bounded_query(">", &from.format("%Y-%m-%d").to_string()),
+ bounded_query("<", "date()")
)
}
@@ -382,7 +382,7 @@ fn cumulative_query(from: NaiveDate) -> String {
///
/// It filters incomes according to the operator and date,
/// and adds the income at this date.
-fn bounded_query(op: String, date: String) -> String {
+fn bounded_query(op: &str, date: &str) -> String {
format!(
r#"
SELECT