mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
fix(napi-derive): call flush on the BufWriter (#2242)
This commit is contained in:
parent
21f712aa50
commit
58bcb64c19
@ -130,7 +130,8 @@ fn output_wasi_register_def(napi: &Napi) {
|
||||
let mut writer = BufWriter::<fs::File>::new(file);
|
||||
let pkg_name: String = std::env::var("CARGO_PKG_NAME").expect("CARGO_PKG_NAME is not set");
|
||||
writer.write_all(format!("{pkg_name}: {}", napi.register_name()).as_bytes())?;
|
||||
writer.write_all("\n".as_bytes())
|
||||
writer.write_all("\n".as_bytes())?;
|
||||
writer.flush()
|
||||
})
|
||||
.unwrap_or_else(|e| {
|
||||
println!("Failed to write wasi register file: {:?}", e);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user