File tree Expand file tree Collapse file tree 1 file changed +17
-20
lines changed
Expand file tree Collapse file tree 1 file changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -13,28 +13,25 @@ pub async fn poll_results(
1313) -> Result < ( ) > {
1414 let response = poll_run_report ( api_client, upload_result) . await ?;
1515
16- let report = response
17- . run
18- . head_reports
19- . into_iter ( )
20- . next ( )
21- . ok_or_else ( || anyhow ! ( "No head report found in the run report" ) ) ?;
16+ let report = response. run . head_reports . into_iter ( ) . next ( ) ;
2217
23- if let Some ( impact) = report. impact {
24- let rounded_impact = ( impact * 100.0 ) . round ( ) ;
25- let impact_text = if impact > 0.0 {
26- style ( format ! ( "+{rounded_impact}%" ) ) . green ( ) . bold ( )
27- } else {
28- style ( format ! ( "{rounded_impact}%" ) ) . red ( ) . bold ( )
29- } ;
18+ if let Some ( report) = report {
19+ if let Some ( impact) = report. impact {
20+ let rounded_impact = ( impact * 100.0 ) . round ( ) ;
21+ let impact_text = if impact > 0.0 {
22+ style ( format ! ( "+{rounded_impact}%" ) ) . green ( ) . bold ( )
23+ } else {
24+ style ( format ! ( "{rounded_impact}%" ) ) . red ( ) . bold ( )
25+ } ;
3026
31- info ! (
32- "Impact: {} (allowed regression: -{}%)" ,
33- impact_text,
34- ( response. allowed_regression * 100.0 ) . round( )
35- ) ;
36- } else {
37- info ! ( "No impact detected, reason: {}" , report. conclusion) ;
27+ info ! (
28+ "Impact: {} (allowed regression: -{}%)" ,
29+ impact_text,
30+ ( response. allowed_regression * 100.0 ) . round( )
31+ ) ;
32+ } else {
33+ info ! ( "No impact detected, reason: {}" , report. conclusion) ;
34+ }
3835 }
3936
4037 if output_json {
You can’t perform that action at this time.
0 commit comments