We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2a62242 + bad285c commit a025675Copy full SHA for a025675
src/libsyntax/print/pp.rs
@@ -508,10 +508,14 @@ impl<'a> Printer<'a> {
508
}
509
pub fn print_newline(&mut self, amount: isize) -> io::Result<()> {
510
debug!("NEWLINE {}", amount);
511
- let ret = write!(self.out, "\n");
+ let ret = if cfg!(windows) {
512
+ self.out.write_all(b"\r\n")
513
+ } else {
514
+ self.out.write_all(b"\n")
515
+ };
516
self.pending_indentation = 0;
517
self.indent(amount);
- return ret;
518
+ ret
519
520
pub fn indent(&mut self, amount: isize) {
521
debug!("INDENT {}", amount);
0 commit comments