@@ -50,7 +50,7 @@ impl Database {
5050 pub fn get_prices_for_user ( & self , maybe_user_id : Option < i32 > ) -> Result < Vec < Price > , String > {
5151 let user_id = self . resolve_user_id_protected ( maybe_user_id) ?;
5252 let mut conn = self . pool . get ( ) . unwrap ( ) ;
53- return prices:: table
53+ prices:: table
5454 . inner_join (
5555 currentprices:: table. on ( prices:: type_id
5656 . eq ( currentprices:: type_id)
@@ -73,7 +73,7 @@ impl Database {
7373 . into_iter ( )
7474 . filter ( |price| price. price . is_some ( ) )
7575 . collect ( )
76- } ) ;
76+ } )
7777 }
7878
7979 pub fn get_conventions_for_user (
@@ -122,7 +122,7 @@ impl Database {
122122 )
123123 } ) ?;
124124
125- let date = end_date. and_hms ( 23 , 59 , 59 ) ;
125+ let date = end_date. and_hms_opt ( 23 , 59 , 59 ) . unwrap ( ) ;
126126
127127 // TODO: was nice when the counting could be done in SQL... maybe someday it can be improved
128128 let items_sold: HashMap < i32 , i64 > = records:: table
@@ -241,8 +241,8 @@ impl Database {
241241 )
242242 } ) ?;
243243
244- let date = end_date. and_hms ( 23 , 59 , 59 ) ;
245- return prices:: table
244+ let date = end_date. and_hms_opt ( 23 , 59 , 59 ) . unwrap ( ) ;
245+ prices:: table
246246 . inner_join (
247247 currentprices:: table. on ( prices:: type_id
248248 . eq ( currentprices:: type_id)
@@ -271,6 +271,6 @@ impl Database {
271271 . into_iter ( )
272272 . filter ( |price| price. price . is_some ( ) )
273273 . collect ( )
274- } ) ;
274+ } )
275275 }
276276}
0 commit comments