Skip to content

Commit 1af1f62

Browse files
committed
Fix clippy::print_with_newline
1 parent 33f58ba commit 1af1f62

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_errors/emitter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ impl EmitterWriter {
13391339
}
13401340

13411341
let mut dst = self.dst.writable();
1342-
match write!(dst, "\n") {
1342+
match writeln!(dst) {
13431343
Err(e) => panic!("failed to emit error: {}", e),
13441344
_ => {
13451345
match dst.flush() {
@@ -1598,7 +1598,7 @@ fn emit_to_destination(rendered_buffer: &[Vec<StyledString>],
15981598
dst.reset()?;
15991599
}
16001600
if !short_message && (!lvl.is_failure_note() || pos != rendered_buffer.len() - 1) {
1601-
write!(dst, "\n")?;
1601+
writeln!(dst)?;
16021602
}
16031603
}
16041604
dst.flush()?;

src/libsyntax/print/pp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ impl<'a> Printer<'a> {
497497

498498
pub fn print_newline(&mut self, amount: isize) -> io::Result<()> {
499499
debug!("NEWLINE {}", amount);
500-
let ret = write!(self.out, "\n");
500+
let ret = writeln!(self.out);
501501
self.pending_indentation = 0;
502502
self.indent(amount);
503503
ret

0 commit comments

Comments
 (0)