@@ -1391,7 +1391,7 @@ impl Builder {
1391
1391
1392
1392
{
1393
1393
let mut wrapper_file = File :: create ( & wrapper_path) ?;
1394
- wrapper_file. write ( wrapper_contents. as_bytes ( ) ) ?;
1394
+ wrapper_file. write_all ( wrapper_contents. as_bytes ( ) ) ?;
1395
1395
}
1396
1396
1397
1397
let mut cmd = Command :: new ( & clang. path ) ;
@@ -2088,30 +2088,30 @@ impl Bindings {
2088
2088
"/* automatically generated by rust-bindgen {} */\n \n " ,
2089
2089
version. unwrap_or( "(unknown version)" )
2090
2090
) ;
2091
- writer. write ( header. as_bytes ( ) ) ?;
2091
+ writer. write_all ( header. as_bytes ( ) ) ?;
2092
2092
}
2093
2093
2094
2094
for line in self . options . raw_lines . iter ( ) {
2095
- writer. write ( line. as_bytes ( ) ) ?;
2096
- writer. write ( "\n " . as_bytes ( ) ) ?;
2095
+ writer. write_all ( line. as_bytes ( ) ) ?;
2096
+ writer. write_all ( "\n " . as_bytes ( ) ) ?;
2097
2097
}
2098
2098
2099
2099
if !self . options . raw_lines . is_empty ( ) {
2100
- writer. write ( "\n " . as_bytes ( ) ) ?;
2100
+ writer. write_all ( "\n " . as_bytes ( ) ) ?;
2101
2101
}
2102
2102
2103
2103
let bindings = self . module . to_string ( ) ;
2104
2104
2105
2105
match self . rustfmt_generated_string ( & bindings) {
2106
2106
Ok ( rustfmt_bindings) => {
2107
- writer. write ( rustfmt_bindings. as_bytes ( ) ) ?;
2107
+ writer. write_all ( rustfmt_bindings. as_bytes ( ) ) ?;
2108
2108
}
2109
2109
Err ( err) => {
2110
2110
eprintln ! (
2111
2111
"Failed to run rustfmt: {} (non-fatal, continuing)" ,
2112
2112
err
2113
2113
) ;
2114
- writer. write ( bindings. as_bytes ( ) ) ?;
2114
+ writer. write_all ( bindings. as_bytes ( ) ) ?;
2115
2115
}
2116
2116
}
2117
2117
Ok ( ( ) )
0 commit comments