We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3dbfa74 commit 121c8ceCopy full SHA for 121c8ce
src/libsyntax/print/pp.rs
@@ -507,8 +507,14 @@ impl<'a> Printer<'a> {
507
}
508
509
pub fn print_newline(&mut self, amount: isize) -> io::Result<()> {
510
+ #[cfg(windows)]
511
+ const NEWLINE: &'static str = "\r\n";
512
+
513
+ #[cfg(not(windows))]
514
+ const NEWLINE: &'static str = "\n";
515
516
debug!("NEWLINE {}", amount);
- let ret = write!(self.out, "\n");
517
+ let ret = self.out.write_all(NEWLINE.as_bytes());
518
self.pending_indentation = 0;
519
self.indent(amount);
520
return ret;
0 commit comments