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/queries.rs | |
parent | 3932daa26360d6e03807381d0b8ffa2d0e704847 (diff) |
Follow clippy indications
Diffstat (limited to 'src/queries.rs')
-rw-r--r-- | src/queries.rs | 58 |
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() { |