fix verbose output

This commit is contained in:
Stéphane Campinas 2018-08-16 20:00:49 +02:00
parent dd14d304ef
commit 2db2327aaf
No known key found for this signature in database
GPG Key ID: 6D5620D908210133

View File

@ -87,13 +87,13 @@ fn format_project<T: FormatHandler>(
if (config.skip_children() && path != main_file) || config.ignore().skip_file(&path) {
continue;
}
should_emit_verbose(!input_is_stdin, config, || println!("Formatting {}", path));
should_emit_verbose(input_is_stdin, config, || println!("Formatting {}", path));
let is_root = path == main_file;
context.format_file(path, module, is_root)?;
}
timer = timer.done_formatting();
should_emit_verbose(!input_is_stdin, config, || {
should_emit_verbose(input_is_stdin, config, || {
println!(
"Spent {0:.3} secs in the parsing phase, and {1:.3} secs in the formatting phase",
timer.get_parse_time(),
@ -611,7 +611,7 @@ fn parse_crate(
// Note that if you see this message and want more information,
// then run the `parse_crate_mod` function above without
// `catch_unwind` so rustfmt panics and you can get a backtrace.
should_emit_verbose(!input_is_stdin, config, || {
should_emit_verbose(input_is_stdin, config, || {
println!("The Rust parser panicked")
});
}