@@ -7,20 +7,20 @@ use std::fs;
7
7
use std:: io:: Write ;
8
8
use std:: path:: { Path , PathBuf } ;
9
9
10
- pub fn check ( root_path : & Path , bless : bool , bad : & mut bool ) {
11
- let issues_txt_header = r#"============================================================
10
+ const ISSUES_TXT_HEADER : & str = r#"============================================================
12
11
⚠️⚠️⚠️NOTHING SHOULD EVER BE ADDED TO THIS LIST⚠️⚠️⚠️
13
12
============================================================
14
13
"# ;
15
14
15
+ pub fn check ( root_path : & Path , bless : bool , bad : & mut bool ) {
16
16
let path = & root_path. join ( "tests" ) ;
17
17
18
18
// the list of files in ui tests that are allowed to start with `issue-XXXX`
19
19
// BTreeSet because we would like a stable ordering so --bless works
20
20
let mut prev_line = "" ;
21
21
let mut is_sorted = true ;
22
22
let allowed_issue_names: BTreeSet < _ > = include_str ! ( "issues.txt" )
23
- . strip_prefix ( issues_txt_header )
23
+ . strip_prefix ( ISSUES_TXT_HEADER )
24
24
. unwrap ( )
25
25
. lines ( )
26
26
. inspect ( |& line| {
@@ -78,7 +78,7 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
78
78
// so we don't bork things on panic or a contributor using Ctrl+C
79
79
let blessed_issues_path = tidy_src. join ( "issues_blessed.txt" ) ;
80
80
let mut blessed_issues_txt = fs:: File :: create ( & blessed_issues_path) . unwrap ( ) ;
81
- blessed_issues_txt. write_all ( issues_txt_header . as_bytes ( ) ) . unwrap ( ) ;
81
+ blessed_issues_txt. write_all ( ISSUES_TXT_HEADER . as_bytes ( ) ) . unwrap ( ) ;
82
82
// If we changed paths to use the OS separator, reassert Unix chauvinism for blessing.
83
83
for filename in allowed_issue_names. difference ( & remaining_issue_names) {
84
84
writeln ! ( blessed_issues_txt, "{filename}" ) . unwrap ( ) ;
0 commit comments