]> git.lizzy.rs Git - rust.git/commitdiff
don't silence error unnecessary
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 13 Apr 2016 22:39:39 +0000 (01:39 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 13 Apr 2016 22:39:39 +0000 (01:39 +0300)
This `if` was used to separate error output from the formatting output, when they both used stdout. It was useful for integration with tools, which can submit input to stdin and read pretty printed result from stdout without worrying about errors intermingled with the actual result.

But now we write errors to `stderr`, so the problem disappears and we can safely remove this `if`.

Errors should never pass silently, unless explicitly silenced.

src/lib.rs

index 92b6ffb8527ae4b6c1721024214752467b5dfef4..d0ff4be72415ebef89cdf84666586358765dd650 100644 (file)
@@ -422,11 +422,7 @@ pub enum Input {
 
 pub fn run(input: Input, config: &Config) {
     let (file_map, report) = format_input(input, config);
-
-    let ignore_errors = config.write_mode == WriteMode::Plain;
-    if !ignore_errors {
-        msg!("{}", report);
-    }
+    msg!("{}", report);
 
     let mut out = stdout();
     let write_result = filemap::write_all_files(&file_map, &mut out, config);