diff --git a/librubyfmt/src/render_queue_writer.rs b/librubyfmt/src/render_queue_writer.rs index 977d5151..bf256213 100644 --- a/librubyfmt/src/render_queue_writer.rs +++ b/librubyfmt/src/render_queue_writer.rs @@ -310,7 +310,7 @@ impl<'src> RenderQueueWriter<'src> { for line_token in tokens.into_iter() { let s = line_token.into_ruby(); - write!(writer, "{}", s)? + writer.write_all(s.as_bytes())?; } Ok(()) } diff --git a/src/main.rs b/src/main.rs index 45cd97cc..5b9f0774 100644 --- a/src/main.rs +++ b/src/main.rs @@ -330,7 +330,9 @@ fn iterate_formatted(opts: &CommandlineOpts, f: FormattingFunc) { } fn puts_stdout(input: &String) { - write!(io::stdout(), "{}", input).expect("Could not write to stdout"); + io::stdout() + .write_all(input.as_bytes()) + .expect("Could not write to stdout"); io::stdout().flush().expect("flush works"); } @@ -386,7 +388,7 @@ fn main() { .write(true) .truncate(true) .open(file_path) - .and_then(|mut file| write!(file, "{}", fmtted)); + .and_then(|mut file| file.write_all(fmtted.as_bytes())); match file_write { Ok(_) => {}