diff options
author | Varphone Wong <varphone@qq.com> | 2020-08-08 21:57:41 +0800 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-08-09 13:02:35 +0200 |
commit | f91c9b6604bef0abe3bbb0d4e659d445a463a06d (patch) | |
tree | 0e8b2a763132957b1c3a391164e0231931358090 | |
parent | 53290e8f3535f118bcc06c048d34740233ef7821 (diff) |
Cleanup some `clippy::unused_io_amount` errors
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1391,7 +1391,7 @@ impl Builder { { let mut wrapper_file = File::create(&wrapper_path)?; - wrapper_file.write(wrapper_contents.as_bytes())?; + wrapper_file.write_all(wrapper_contents.as_bytes())?; } let mut cmd = Command::new(&clang.path); @@ -2088,30 +2088,30 @@ impl Bindings { "/* automatically generated by rust-bindgen {} */\n\n", version.unwrap_or("(unknown version)") ); - writer.write(header.as_bytes())?; + writer.write_all(header.as_bytes())?; } for line in self.options.raw_lines.iter() { - writer.write(line.as_bytes())?; - writer.write("\n".as_bytes())?; + writer.write_all(line.as_bytes())?; + writer.write_all("\n".as_bytes())?; } if !self.options.raw_lines.is_empty() { - writer.write("\n".as_bytes())?; + writer.write_all("\n".as_bytes())?; } let bindings = self.module.to_string(); match self.rustfmt_generated_string(&bindings) { Ok(rustfmt_bindings) => { - writer.write(rustfmt_bindings.as_bytes())?; + writer.write_all(rustfmt_bindings.as_bytes())?; } Err(err) => { eprintln!( "Failed to run rustfmt: {} (non-fatal, continuing)", err ); - writer.write(bindings.as_bytes())?; + writer.write_all(bindings.as_bytes())?; } } Ok(()) |