Cleanup some `clippy::unused_io_amount` errors
@@ -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(())
