diff --git a/src/gas_metering/backend.rs b/src/gas_metering/backend.rs index 3652650..f8d9e65 100644 --- a/src/gas_metering/backend.rs +++ b/src/gas_metering/backend.rs @@ -116,7 +116,7 @@ pub mod mutable_global { cost.saturating_add(rules.instruction_cost(instruction).unwrap_or(u32::MAX).into()) }); // don't charge for the instructions used to fail when out of gas - let fail_cost = vec![ + let fail_cost = [ Instruction::I64Const(-1i64), // non-charged instruction Instruction::SetGlobal(gas_global_idx), // non-charged instruction Instruction::Unreachable, // non-charged instruction diff --git a/src/stack_limiter/thunk.rs b/src/stack_limiter/thunk.rs index d28cd35..05481f9 100644 --- a/src/stack_limiter/thunk.rs +++ b/src/stack_limiter/thunk.rs @@ -1,12 +1,8 @@ -#[cfg(not(features = "std"))] -use alloc::collections::BTreeMap as Map; -use alloc::vec::Vec; +use alloc::{collections::BTreeMap as Map, vec::Vec}; use parity_wasm::{ builder, elements::{self, FunctionType, Internal}, }; -#[cfg(features = "std")] -use std::collections::HashMap as Map; use super::{resolve_func_type, Context};