Skip to content

Commit

Permalink
Fix clippy::print_with_newline
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Jun 26, 2019
1 parent 33f58ba commit 1af1f62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/librustc_errors/emitter.rs
Expand Up @@ -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() {
Expand Down Expand Up @@ -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()?;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/print/pp.rs
Expand Up @@ -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
Expand Down

0 comments on commit 1af1f62

Please sign in to comment.