mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-15 16:11:00 +00:00
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:
committed by
GitHub
parent
fdce5c64f1
commit
fd3b1f856b
@@ -116,7 +116,7 @@ pub mod mutable_global {
|
|||||||
cost.saturating_add(rules.instruction_cost(instruction).unwrap_or(u32::MAX).into())
|
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
|
// 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::I64Const(-1i64), // non-charged instruction
|
||||||
Instruction::SetGlobal(gas_global_idx), // non-charged instruction
|
Instruction::SetGlobal(gas_global_idx), // non-charged instruction
|
||||||
Instruction::Unreachable, // non-charged instruction
|
Instruction::Unreachable, // non-charged instruction
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
#[cfg(not(features = "std"))]
|
use alloc::{collections::BTreeMap as Map, vec::Vec};
|
||||||
use alloc::collections::BTreeMap as Map;
|
|
||||||
use alloc::vec::Vec;
|
|
||||||
use parity_wasm::{
|
use parity_wasm::{
|
||||||
builder,
|
builder,
|
||||||
elements::{self, FunctionType, Internal},
|
elements::{self, FunctionType, Internal},
|
||||||
};
|
};
|
||||||
#[cfg(features = "std")]
|
|
||||||
use std::collections::HashMap as Map;
|
|
||||||
|
|
||||||
use super::{resolve_func_type, Context};
|
use super::{resolve_func_type, Context};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user