Skip to content

Commit bd698b9

Browse files
committed
Don't panic if we have tidy errors.
Otherwise we get the standard Rust panic message alongside "some tidy checks failed" which seems unnecessary.
1 parent 5e122f5 commit bd698b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tools/tidy/src/main.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
1717
extern crate regex;
1818

19+
use std::env;
1920
use std::fs;
21+
use std::io::{self, Write};
2022
use std::path::{PathBuf, Path};
21-
use std::env;
23+
use std::process;
2224

2325
macro_rules! t {
2426
($e:expr, $p:expr) => (match $e {
@@ -60,7 +62,8 @@ fn main() {
6062
}
6163

6264
if bad {
63-
panic!("some tidy checks failed");
65+
writeln!(io::stderr(), "some tidy checks failed").expect("could not write to stderr");
66+
process::exit(1);
6467
}
6568
}
6669

0 commit comments

Comments
 (0)