Skip to content

Commit ae3bead

Browse files
committed
example: Enhance the build script
Replace write with write_all to ensure the completion of the write operation. Signed-off-by: Tim Zhang <tim@hyper.sh>
1 parent e8be818 commit ae3bead

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn replace_text_in_file(file_name: &str, from: &str, to: &str) -> Result<(), std
8080
let new_contents = contents.replace(from, to);
8181

8282
let mut dst = File::create(file_name)?;
83-
dst.write(new_contents.as_bytes())?;
83+
dst.write_all(new_contents.as_bytes())?;
8484

8585
Ok(())
8686
}

0 commit comments

Comments
 (0)