Skip to content

Commit cc9eced

Browse files
committed
Fix more clippy issues
1 parent 2b0f5bc commit cc9eced

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

dbif/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ pub fn get_invoices_from_db(filepath: &String, invtype: &str, index: u64, max: u
619619
"idx >= :idx"
620620
};
621621

622-
conditions.push(&cond);
622+
conditions.push(cond);
623623

624624
let strindex = index.to_string();
625625
bindings.insert(":idx", &strindex);
@@ -638,14 +638,14 @@ pub fn get_invoices_from_db(filepath: &String, invtype: &str, index: u64, max: u
638638

639639
let start_date = filters.start_date.unwrap_or_default().to_string();
640640

641-
if start_date != "" && start_date != "0" {
641+
if !start_date.is_empty() && start_date != "0" {
642642
conditions.push("time >= :start_date");
643643
bindings.insert(":start_date", &start_date);
644644
}
645645

646646
let end_date = filters.end_date.unwrap_or_default().to_string();
647647

648-
if end_date != "" && end_date != "0" {
648+
if !end_date.is_empty() && end_date != "0" {
649649
conditions.push("time <= :end_date");
650650
bindings.insert(":end_date", &end_date);
651651
}
@@ -874,7 +874,7 @@ pub fn get_payments_from_db(filepath: &String, index: u64, max: u64, direction:
874874
"idx >= :idx"
875875
};
876876

877-
conditions.push(&cond);
877+
conditions.push(cond);
878878

879879
let strindex = index.to_string();
880880
bindings.insert(":idx", &strindex);
@@ -886,14 +886,14 @@ pub fn get_payments_from_db(filepath: &String, index: u64, max: u64, direction:
886886

887887
let start_date = filters.start_date.unwrap_or_default().to_string();
888888

889-
if start_date != "" && start_date != "0" {
889+
if !start_date.is_empty() && start_date != "0" {
890890
conditions.push("time >= :start_date");
891891
bindings.insert(":start_date", &start_date);
892892
}
893893

894894
let end_date = filters.end_date.unwrap_or_default().to_string();
895895

896-
if end_date != "" && end_date != "0" {
896+
if !end_date.is_empty() && end_date != "0" {
897897
conditions.push("time <= :end_date");
898898
bindings.insert(":end_date", &end_date);
899899
}

src/handler.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use std::{fs, str};
2424
use std::string::String;
2525
use url::Url;
2626
use tempfile::NamedTempFile;
27-
use reqwest;
2827
use std::collections::HashMap;
2928
//Structs and Enums ------------------------------------------------------------------------------------------
3029
#[derive(Debug, Serialize, Deserialize)]
@@ -1065,7 +1064,7 @@ pub async fn report_generate(
10651064

10661065
let mut filters = BoostFilters::new();
10671066

1068-
if form.podcast != "" {
1067+
if !form.podcast.is_empty() {
10691068
filters.podcast = Some(form.podcast);
10701069
}
10711070

@@ -1104,7 +1103,7 @@ pub async fn report_generate(
11041103
}
11051104

11061105
csv.push_str(&headers);
1107-
csv.push_str("\n");
1106+
csv.push('\n');
11081107

11091108
for list in lists {
11101109
let results;
@@ -1183,7 +1182,7 @@ pub async fn report_generate(
11831182
}
11841183
}
11851184

1186-
csv.push_str("\n");
1185+
csv.push('\n');
11871186
}
11881187
}
11891188

0 commit comments

Comments
 (0)