Skip to content

Commit 453270e

Browse files
committed
remove unused BumpFuelConsumption ext trait
1 parent e249f9c commit 453270e

File tree

1 file changed

+1
-22
lines changed
  • crates/wasmi/src/engine/translator

1 file changed

+1
-22
lines changed

crates/wasmi/src/engine/translator/utils.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
22
core::{Typed, TypedVal, UntypedVal},
3-
ir::{Op, Sign},
4-
Error,
3+
ir::Sign,
54
ExternRef,
65
Func,
76
Ref,
@@ -141,26 +140,6 @@ impl_wrap_for! {
141140
u64 => u32,
142141
}
143142

144-
/// Extension trait to bump the consumed fuel of [`Op::ConsumeFuel`].
145-
pub trait BumpFuelConsumption {
146-
/// Increases the fuel consumption of the [`Op::ConsumeFuel`] instruction by `delta`.
147-
///
148-
/// # Error
149-
///
150-
/// - If `self` is not a [`Op::ConsumeFuel`] instruction.
151-
/// - If the new fuel consumption overflows the internal `u64` value.
152-
fn bump_fuel_consumption(&mut self, delta: u64) -> Result<(), Error>;
153-
}
154-
155-
impl BumpFuelConsumption for Op {
156-
fn bump_fuel_consumption(&mut self, delta: u64) -> Result<(), Error> {
157-
match self {
158-
Self::ConsumeFuel { fuel } => fuel.bump_by(delta).map_err(Error::from),
159-
instr => panic!("expected `Op::ConsumeFuel` but found: {instr:?}"),
160-
}
161-
}
162-
}
163-
164143
/// Types that can be converted into bits.
165144
pub trait ToBits {
166145
/// The output bits type of [`ToBits`].

0 commit comments

Comments
 (0)