diff options
| author | Mika Attila <radiantstatue@gmail.com> | 2015-11-14 19:01:28 +0100 |
|---|---|---|
| committer | Mika Attila <radiantstatue@gmail.com> | 2015-11-14 19:01:28 +0100 |
| commit | 5b06ed6817c84ed05f1e1e3c7be68afbc7bde4e8 (patch) | |
| tree | 2587dbfda4ef6f66db50312a72aceb33010a3ef5 /src | |
| parent | 2cf22300028b6480618e16f6b70e38ba37245945 (diff) | |
Don't print an unnecessary newline after printing format report
The Display implementation for FormatReport already prints a newline after every error. However, if the format report does not contain errors, we don't want to print an empty newline. This behavior clutters up the console output with empty lines when rustfmt is invoked multiple times (from .e.g a script or cargo-fmt). So instead of using println! to print the report, we just use print!.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs index 4c7b3cbd249..e73ed86599d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -440,7 +440,7 @@ pub fn format(file: &Path, config: &Config, mode: WriteMode) -> FileMap { pub fn run(file: &Path, write_mode: WriteMode, config: &Config) { let mut result = format(file, config, write_mode); - println!("{}", fmt_lines(&mut result, config)); + print!("{}", fmt_lines(&mut result, config)); let write_result = filemap::write_all_files(&result, write_mode, config); |
