File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,7 @@ pub async fn generate_home_response(key: &SessionKey) -> Result<HomeResponse, Pr
9797 . map ( |i| {
9898 Utc :: now ( )
9999 . checked_sub_signed ( chrono:: Duration :: days ( i) )
100- . ok_or_else ( || anyhow:: Error :: msg ( "Date conversion failed" ) )
101- . unwrap ( )
100+ . expect ( "Date conversion failed" )
102101 } )
103102 . map ( |date| date. format ( "%Y-%m-%d" ) . to_string ( ) )
104103 . collect_vec ( ) ;
@@ -331,12 +330,7 @@ async fn get_dashboard_titles(key: &SessionKey) -> Result<Vec<TitleAndId>, Prism
331330 . iter ( )
332331 . map ( |dashboard| TitleAndId {
333332 title : dashboard. name . clone ( ) ,
334- id : dashboard
335- . dashboard_id
336- . as_ref ( )
337- . ok_or_else ( || anyhow:: Error :: msg ( "Dashboard ID is null" ) )
338- . unwrap ( )
339- . clone ( ) ,
333+ id : dashboard. dashboard_id . as_ref ( ) . unwrap ( ) . clone ( ) ,
340334 } )
341335 . collect_vec ( ) ;
342336
@@ -350,12 +344,7 @@ async fn get_filter_titles(key: &SessionKey) -> Result<Vec<TitleAndId>, PrismHom
350344 . iter ( )
351345 . map ( |filter| TitleAndId {
352346 title : filter. filter_name . clone ( ) ,
353- id : filter
354- . filter_id
355- . as_ref ( )
356- . ok_or_else ( || anyhow:: Error :: msg ( "Filter ID is null" ) )
357- . unwrap ( )
358- . clone ( ) ,
347+ id : filter. filter_id . as_ref ( ) . unwrap ( ) . clone ( ) ,
359348 } )
360349 . collect_vec ( ) ;
361350
You can’t perform that action at this time.
0 commit comments