chore: fix clippy warnings on latest nightly rust (#78)

btw `#[cfg(...)]` was used implicitly and expanded always lead to `use
alloc::collections::BTreeMap as Map;`
the second `cfg(std)` just doesn't work bcz `featureS`
This commit is contained in:
StackOverflowExcept1on
2023-11-07 12:03:36 +03:00
committed by GitHub
parent fdce5c64f1
commit fd3b1f856b
2 changed files with 2 additions and 6 deletions
+1 -1
View File
@@ -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
+1 -5
View File
@@ -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};