diff options
| author | Igor Matuszewski <Xanewok@gmail.com> | 2019-06-26 14:11:40 +0200 |
|---|---|---|
| committer | Igor Matuszewski <Xanewok@gmail.com> | 2019-06-26 14:11:58 +0200 |
| commit | 1af1f6277e78cb3e1d9c3aafc1e5a65c58916023 (patch) | |
| tree | 0d2b71ea1bce97779864af1cce3dabc5674d05e6 /src | |
| parent | 33f58baf6eb6beea0ec5c93b1c81714b05eae378 (diff) | |
| download | rust-1af1f6277e78cb3e1d9c3aafc1e5a65c58916023.tar.gz rust-1af1f6277e78cb3e1d9c3aafc1e5a65c58916023.zip | |
Fix clippy::print_with_newline
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/print/pp.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index fca8298409a..a2717ab7ad8 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1339,7 +1339,7 @@ impl EmitterWriter { } let mut dst = self.dst.writable(); - match write!(dst, "\n") { + match writeln!(dst) { Err(e) => panic!("failed to emit error: {}", e), _ => { match dst.flush() { @@ -1598,7 +1598,7 @@ fn emit_to_destination(rendered_buffer: &[Vec<StyledString>], dst.reset()?; } if !short_message && (!lvl.is_failure_note() || pos != rendered_buffer.len() - 1) { - write!(dst, "\n")?; + writeln!(dst)?; } } dst.flush()?; diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 45eb6995a76..f5412f3e216 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -497,7 +497,7 @@ impl<'a> Printer<'a> { pub fn print_newline(&mut self, amount: isize) -> io::Result<()> { debug!("NEWLINE {}", amount); - let ret = write!(self.out, "\n"); + let ret = writeln!(self.out); self.pending_indentation = 0; self.indent(amount); ret |
