From 2306999c9cca1cd3f57de6eb43a174d74984b7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Thu, 8 Oct 2020 15:38:11 +0200 Subject: [PATCH] Fix using Write::write without checking the return value Use write_all instead which garantues that the whole buffer was written. --- cli/build/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build/main.rs b/cli/build/main.rs index 9ed2d90..612553e 100644 --- a/cli/build/main.rs +++ b/cli/build/main.rs @@ -230,7 +230,7 @@ mod tests { let wasm_path = target_path.join("example_wasm.wasm"); let mut f = fs::File::create(wasm_path).expect("create fail failed"); - f.write(b"\0asm").expect("write file failed"); + f.write_all(b"\0asm").expect("write file failed"); } let path = tmp_dir.path().to_string_lossy();