@@ -604,8 +604,8 @@ async fn summarize_run(ctxt: &SiteCtxt, commit: QueuedCommit, is_master_commit:
604
604
return format ! ( "This benchmark run did not return any relevant results.\n \n {footer}" ) ;
605
605
}
606
606
607
- let ( primary_short_summary, primary_direction ) = generate_short_summary ( & primary) ;
608
- let ( secondary_short_summary, secondary_direction ) = generate_short_summary ( & secondary) ;
607
+ let primary_short_summary = generate_short_summary ( & primary) ;
608
+ let secondary_short_summary = generate_short_summary ( & secondary) ;
609
609
610
610
let mut summary = format ! (
611
611
r#"
@@ -619,7 +619,7 @@ async fn summarize_run(ctxt: &SiteCtxt, commit: QueuedCommit, is_master_commit:
619
619
620
620
write ! ( summary, "\n {footer}" ) . unwrap ( ) ;
621
621
622
- let direction = primary_direction . or ( secondary_direction ) ;
622
+ let direction = primary . direction ( ) . or ( secondary . direction ( ) ) ;
623
623
let next_steps = next_steps ( primary, secondary, direction, is_master_commit) ;
624
624
625
625
format ! (
@@ -705,7 +705,7 @@ compiler perf.{next_steps}
705
705
)
706
706
}
707
707
708
- fn generate_short_summary ( summary : & ComparisonSummary ) -> ( String , Option < Direction > ) {
708
+ fn generate_short_summary ( summary : & ComparisonSummary ) -> String {
709
709
// Add an "s" to a word unless there's only one.
710
710
fn ending ( word : & ' static str , count : usize ) -> std:: borrow:: Cow < ' static , str > {
711
711
if count == 1 {
@@ -714,25 +714,20 @@ fn generate_short_summary(summary: &ComparisonSummary) -> (String, Option<Direct
714
714
format ! ( "{}s" , word) . into ( )
715
715
}
716
716
717
- if summary. is_relevant ( ) {
718
- let direction = summary. direction ( ) . unwrap ( ) ;
719
- let num_improvements = summary. number_of_improvements ( ) ;
720
- let num_regressions = summary. number_of_regressions ( ) ;
717
+ let num_improvements = summary. number_of_improvements ( ) ;
718
+ let num_regressions = summary. number_of_regressions ( ) ;
721
719
722
- let text = match direction {
723
- Direction :: Improvement => format ! (
724
- "🎉 relevant {} found" ,
725
- ending( "improvement" , num_improvements)
726
- ) ,
727
- Direction :: Regression => format ! (
728
- "😿 relevant {} found" ,
729
- ending( "regression" , num_regressions)
730
- ) ,
731
- Direction :: Mixed => "mixed results" . to_string ( ) ,
732
- } ;
733
- ( text, Some ( direction) )
734
- } else {
735
- ( "no relevant changes found" . to_string ( ) , None )
720
+ match summary. direction ( ) {
721
+ Some ( Direction :: Improvement ) => format ! (
722
+ "🎉 relevant {} found" ,
723
+ ending( "improvement" , num_improvements)
724
+ ) ,
725
+ Some ( Direction :: Regression ) => format ! (
726
+ "😿 relevant {} found" ,
727
+ ending( "regression" , num_regressions)
728
+ ) ,
729
+ Some ( Direction :: Mixed ) => "mixed results" . to_string ( ) ,
730
+ None => "no relevant changes found" . to_string ( ) ,
736
731
}
737
732
}
738
733
0 commit comments