diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-03-19 11:22:48 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2017-04-01 20:59:45 -0400 |
| commit | bd698b9e8b02e27409123e71c0594523b926b850 (patch) | |
| tree | 9a9230e16a451f5f95bf7c229ea72fc031134e19 | |
| parent | 5e122f59ba23494d460466cca53c71646d99c767 (diff) | |
| download | rust-bd698b9e8b02e27409123e71c0594523b926b850.tar.gz rust-bd698b9e8b02e27409123e71c0594523b926b850.zip | |
Don't panic if we have tidy errors.
Otherwise we get the standard Rust panic message alongside "some tidy checks failed" which seems unnecessary.
| -rw-r--r-- | src/tools/tidy/src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 501e35e03e8..d0e8cf9c343 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -16,9 +16,11 @@ extern crate regex; +use std::env; use std::fs; +use std::io::{self, Write}; use std::path::{PathBuf, Path}; -use std::env; +use std::process; macro_rules! t { ($e:expr, $p:expr) => (match $e { @@ -60,7 +62,8 @@ fn main() { } if bad { - panic!("some tidy checks failed"); + writeln!(io::stderr(), "some tidy checks failed").expect("could not write to stderr"); + process::exit(1); } } |
