|
10 | 10 |
|
11 | 11 | use std::collections::HashSet;
|
12 | 12 | use std::fs;
|
13 |
| -use std::io::{self, BufRead, Write}; |
| 13 | +use std::io::{self, BufRead}; |
14 | 14 | use std::path;
|
15 | 15 | use features::{collect_lang_features, collect_lib_features, Status};
|
16 | 16 |
|
@@ -110,29 +110,26 @@ pub fn check(path: &path::Path, bad: &mut bool) {
|
110 | 110 |
|
111 | 111 | // Check for Unstable Book section names with no corresponding SUMMARY.md link
|
112 | 112 | for feature_name in &unstable_book_section_file_names - &unstable_book_links {
|
113 |
| - *bad = true; |
114 |
| - writeln!(io::stderr(), |
115 |
| - "The Unstable Book section '{}' needs to have a link in SUMMARY.md", |
116 |
| - feature_name) |
117 |
| - .expect("could not write to stderr") |
| 113 | + tidy_error!( |
| 114 | + bad, |
| 115 | + "The Unstable Book section '{}' needs to have a link in SUMMARY.md", |
| 116 | + feature_name); |
118 | 117 | }
|
119 | 118 |
|
120 | 119 | // Check for unstable features that don't have Unstable Book sections
|
121 | 120 | for feature_name in &unstable_feature_names - &unstable_book_section_file_names {
|
122 |
| - *bad = true; |
123 |
| - writeln!(io::stderr(), |
124 |
| - "Unstable feature '{}' needs to have a section in The Unstable Book", |
125 |
| - feature_name) |
126 |
| - .expect("could not write to stderr") |
| 121 | + tidy_error!( |
| 122 | + bad, |
| 123 | + "Unstable feature '{}' needs to have a section in The Unstable Book", |
| 124 | + feature_name); |
127 | 125 | }
|
128 | 126 |
|
129 | 127 | // Check for Unstable Book sections that don't have a corresponding unstable feature
|
130 | 128 | for feature_name in &unstable_book_section_file_names - &unstable_feature_names {
|
131 |
| - *bad = true; |
132 |
| - writeln!(io::stderr(), |
133 |
| - "The Unstable Book has a section '{}' which doesn't correspond \ |
134 |
| - to an unstable feature", |
135 |
| - feature_name) |
136 |
| - .expect("could not write to stderr") |
| 129 | + tidy_error!( |
| 130 | + bad, |
| 131 | + "The Unstable Book has a section '{}' which doesn't correspond \ |
| 132 | + to an unstable feature", |
| 133 | + feature_name) |
137 | 134 | }
|
138 | 135 | }
|
0 commit comments