aboutsummaryrefslogtreecommitdiff
path: root/src/queries.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/queries.rs')
-rw-r--r--src/queries.rs58
1 files changed, 20 insertions, 38 deletions
diff --git a/src/queries.rs b/src/queries.rs
index db098e7..8ecc4fe 100644
--- a/src/queries.rs
+++ b/src/queries.rs
@@ -22,62 +22,44 @@ pub fn payments_url(q: Payments) -> String {
Some(p) => params.push(format!("page={}", p)),
};
- match q.frequency {
- Some(Frequency::Monthly) => {
- params.push("frequency=Monthly".to_string())
- }
- _ => (),
+ if let Some(Frequency::Monthly) = q.frequency {
+ params.push("frequency=Monthly".to_string())
};
- match q.highlight {
- Some(id) => params.push(format!("highlight={}", id)),
- _ => (),
+ if let Some(id) = q.highlight {
+ params.push(format!("highlight={}", id))
};
- match q.name {
- Some(str) => {
- if !str.is_empty() {
- params.push(format!("name={}", str))
- }
+ if let Some(str) = q.name {
+ if !str.is_empty() {
+ params.push(format!("name={}", str))
}
- _ => (),
};
- match q.cost {
- Some(str) => {
- if !str.is_empty() {
- params.push(format!("cost={}", str))
- }
+ if let Some(str) = q.cost {
+ if !str.is_empty() {
+ params.push(format!("cost={}", str))
}
- _ => (),
};
- match q.user {
- Some(id) => params.push(format!("user={}", id)),
- _ => (),
+ if let Some(id) = q.user {
+ params.push(format!("user={}", id))
};
- match q.category {
- Some(id) => params.push(format!("category={}", id)),
- _ => (),
+ if let Some(id) = q.category {
+ params.push(format!("category={}", id))
};
- match q.start_date {
- Some(str) => {
- if !str.is_empty() {
- params.push(format!("start_date={}", str))
- }
+ if let Some(str) = q.start_date {
+ if !str.is_empty() {
+ params.push(format!("start_date={}", str))
}
- _ => (),
};
- match q.end_date {
- Some(str) => {
- if !str.is_empty() {
- params.push(format!("end_date={}", str))
- }
+ if let Some(str) = q.end_date {
+ if !str.is_empty() {
+ params.push(format!("end_date={}", str))
}
- _ => (),
};
if params.is_empty() {