@@ -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 }
0 commit comments