Skip to content

Commit 499c86c

Browse files
committed
PR feedback
1 parent 04f1e6f commit 499c86c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

site/src/github.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use serde::Deserialize;
77
use database::ArtifactId;
88
use regex::Regex;
99
use reqwest::header::USER_AGENT;
10-
use std::{sync::Arc, time::Duration};
10+
use std::{fmt::Write, sync::Arc, time::Duration};
1111

1212
lazy_static::lazy_static! {
1313
static ref BODY_TRY_COMMIT: Regex =
@@ -638,7 +638,7 @@ pub async fn post_finished(data: &InputData) {
638638
format!(
639639
"Finished benchmarking try commit ({}): [comparison url]({}).
640640
641-
**Summary**: {}
641+
**Summary**: {}
642642
643643
Benchmarking this pull request likely means that it is \
644644
perf-sensitive, so we're automatically marking it as not fit \
@@ -672,13 +672,20 @@ async fn categorize_benchmark(commit: &database::QueuedCommit, data: &InputData)
672672
Ok(Some(c)) => c,
673673
_ => return String::from("ERROR categorizing benchmark run!"),
674674
};
675+
const DISAGREEMENT: &str = "If you disagree with this performance assessment, \
676+
please file an issue in [rust-lang/rustc-perf](https://github.com/rust-lang/rustc-perf/issues/new).";
675677
let (summary, direction) =
676678
match crate::comparison::ComparisonSummary::summarize_comparison(&comparison) {
677679
Some(s) if s.direction().is_some() => {
678680
let direction = s.direction().unwrap();
679681
(s, direction)
680682
}
681-
_ => return String::from("This benchmark run did not return any significant changes"),
683+
_ => {
684+
return format!(
685+
"This benchmark run did not return any significant changes.\n\n{}",
686+
DISAGREEMENT
687+
)
688+
}
682689
};
683690

684691
use crate::comparison::Direction;
@@ -692,9 +699,9 @@ async fn categorize_benchmark(commit: &database::QueuedCommit, data: &InputData)
692699
category
693700
);
694701
for change in summary.ordered_changes() {
695-
use std::fmt::Write;
696702
write!(result, "- ").unwrap();
697703
change.summary_line(&mut result, None)
698704
}
705+
write!(result, "\n{}", DISAGREEMENT).unwrap();
699706
result
700707
}

0 commit comments

Comments
 (0)