Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Apr 3, 2024
1 parent fbc8b06 commit ebc8ec1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions native/wasmex/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ pub fn get_global_value(

#[rustler::nif(name = "instance_set_global_value", schedule = "DirtyCpu")]
pub fn set_global_value(
env: rustler::Env,
store_or_caller_resource: ResourceArc<StoreOrCallerResource>,
instance_resource: ResourceArc<InstanceResource>,
global_name: String,
Expand Down Expand Up @@ -149,9 +148,8 @@ pub fn set_global_value(

let global_type = global.ty(&store_or_caller).content().clone();

let new_value = decode_term_as_wasm_value(global_type, new_value).ok_or_else(|| {
rustler::Error::Term(Box::new(format!("Cannot convert to a WebAssembly value.")))
})?;
let new_value = decode_term_as_wasm_value(global_type, new_value)
.ok_or_else(|| rustler::Error::Term(Box::new("Cannot convert to a WebAssembly value.")))?;

let val: Val = match new_value {
WasmValue::I32(value) => value.into(),
Expand Down

0 comments on commit ebc8ec1

Please sign in to comment.