From e5832265105d04d48815e4c42f9d8a49b808663d Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Thu, 13 Dec 2018 19:58:08 -0600 Subject: [PATCH] Fix build warning unnecessary unsafe --- src/apis/emscripten/utils.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/apis/emscripten/utils.rs b/src/apis/emscripten/utils.rs index 1a748cc6b..5179b493d 100644 --- a/src/apis/emscripten/utils.rs +++ b/src/apis/emscripten/utils.rs @@ -20,10 +20,8 @@ pub fn is_emscripten_module(module: &Module) -> bool { pub unsafe fn write_to_buf(string: *const c_char, buf: u32, max: u32, instance: &Instance) -> u32 { let buf_addr = instance.memory_offset_addr(0, buf as _) as *mut c_char; - unsafe { - for i in 0..max { - *buf_addr.add(i as _) = *string.add(i as _); - } + for i in 0..max { + *buf_addr.add(i as _) = *string.add(i as _); } buf