From a2d2710010f8bad37d5ce5363373f3d3799e0681 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 16 Apr 2020 13:45:16 -0700 Subject: [PATCH] Fixed suggestions based on feedback --- tests/wasi_serialization.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/wasi_serialization.rs b/tests/wasi_serialization.rs index 49bfca3b1..06e445dc0 100644 --- a/tests/wasi_serialization.rs +++ b/tests/wasi_serialization.rs @@ -39,11 +39,11 @@ wasmer_backends! { ); let state_bytes = { - let instance = module.instantiate(&import_object).unwrap(); + let mut instance = module.instantiate(&import_object).unwrap(); let start: Func<(), ()> = instance.exports.get("_start").unwrap(); start.call().unwrap(); - let state = get_wasi_state(instance.context()); + let state = get_wasi_state(instance.context_mut()); assert_eq!(state.args, args); assert_eq!(state.envs, envs); @@ -63,8 +63,7 @@ wasmer_backends! { assert_eq!(result, true as i32); } - #[allow(clippy::mut_from_ref)] - pub(crate) fn get_wasi_state(ctx: &Ctx) -> &mut WasiState { - unsafe { state::get_wasi_state(&mut *(ctx as *const Ctx as *mut Ctx)) } + pub(crate) fn get_wasi_state(ctx: &mut Ctx) -> &mut WasiState { + unsafe { state::get_wasi_state(ctx) } } }