Skip to content

Commit 9c39e63

Browse files
committed
Various cleanup
1 parent a1345ed commit 9c39e63

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

src/main.rs

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ pub struct Commit {
3838
/// however, it does limit the amount of commits somewhat.
3939
const EPOCH_COMMIT: &str = "927c55d86b0be44337f37cf5b0a76fb8ba86e06c";
4040

41+
const REPORT_HEADER: &str = "\
42+
==================================================================================
43+
= Please file this regression report on the rust-lang/rust GitHub repository =
44+
= New issue: https://github.com/rust-lang/rust/issues/new =
45+
= Known issues: https://github.com/rust-lang/rust/issues =
46+
= Copy and paste the text below into the issue report thread. Thanks! =
47+
==================================================================================";
48+
4149
#[derive(Debug, StructOpt)]
4250
#[structopt(after_help = "EXAMPLES:
4351
Run a fully automatic nightly bisect doing `cargo check`:
@@ -679,12 +687,12 @@ fn print_results(cfg: &Config, client: &Client, bisection_result: &BisectionResu
679687
}
680688

681689
let tc_found = format!("Regression in {}", toolchains[*found]);
682-
eprintln!("");
683-
eprintln!("");
690+
eprintln!();
691+
eprintln!();
684692
eprintln!("{}", "*".repeat(80).dimmed().bold());
685693
eprintln!("{}", tc_found.red());
686694
eprintln!("{}", "*".repeat(80).dimmed().bold());
687-
eprintln!("");
695+
eprintln!();
688696
}
689697

690698
fn print_final_report(
@@ -704,20 +712,8 @@ fn print_final_report(
704712
..
705713
} = ci_bisection_result;
706714

707-
#[rustfmt::skip]
708-
eprintln!("{}", "==================================================================================".dimmed());
709-
#[rustfmt::skip]
710-
eprintln!("{}", "= Please file this regression report on the rust-lang/rust GitHub repository =".dimmed());
711-
#[rustfmt::skip]
712-
eprintln!("{}", "= New issue: https://github.com/rust-lang/rust/issues/new =".dimmed());
713-
#[rustfmt::skip]
714-
eprintln!("{}", "= Known issues: https://github.com/rust-lang/rust/issues =".dimmed());
715-
#[rustfmt::skip]
716-
eprintln!("{}", "= Copy and paste the text below into the issue report thread. Thanks! =".dimmed());
717-
#[rustfmt::skip]
718-
eprintln!("{}", "==================================================================================".dimmed());
719-
720-
eprintln!("");
715+
eprintln!("{}", REPORT_HEADER.dimmed());
716+
eprintln!();
721717

722718
let (start, end) = searched_range(cfg, nightly_toolchains);
723719

@@ -726,7 +722,7 @@ fn print_final_report(
726722
eprintln!("regressed nightly: {}", nightly_toolchains[*nightly_found],);
727723

728724
eprintln!(
729-
"searched commits: from https://github.com/rust-lang/rust/commit/{} to https://github.com/rust-lang/rust/commit/{1}",
725+
"searched commits: from https://github.com/rust-lang/rust/commit/{0} to https://github.com/rust-lang/rust/commit/{1}",
730726
ci_toolchains.first().unwrap(),
731727
ci_toolchains.last().unwrap(),
732728
);
@@ -736,15 +732,15 @@ fn print_final_report(
736732
ci_toolchains[*ci_found],
737733
);
738734

739-
eprintln!("");
735+
eprintln!();
740736
eprintln!("<details>");
741737
eprintln!(
742738
"<summary>bisected with <a href='{}'>cargo-bisect-rustc</a> v{}</summary>",
743739
env!("CARGO_PKG_REPOSITORY"),
744740
env!("CARGO_PKG_VERSION"),
745741
);
746-
eprintln!("");
747-
eprintln!("");
742+
eprintln!();
743+
eprintln!();
748744
if let Some(host) = option_env!("HOST") {
749745
eprintln!("Host triple: {}", host);
750746
}
@@ -757,7 +753,7 @@ fn print_final_report(
757753
eprint!("{} ", arg.to_string_lossy());
758754
}
759755
}
760-
eprintln!("");
756+
eprintln!();
761757
eprintln!("```");
762758
eprintln!("</details>");
763759
}
@@ -1159,7 +1155,7 @@ fn bisect_ci_in_commits(
11591155
}
11601156

11611157
eprintln!("validated commits found, specifying toolchains");
1162-
eprintln!("");
1158+
eprintln!();
11631159

11641160
let toolchains = commits
11651161
.into_iter()

0 commit comments

Comments
 (0)