Skip to content

Commit

Permalink
chore: remove unnecessary type conversions (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu authored Nov 29, 2024
1 parent 4cf45ad commit 1432670
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions crates/wasmi/src/engine/executor/instrs/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ impl Executor<'_> {
}
let memory = self.get_memory(memory);
let (memory, fuel) = store.resolve_memory_and_fuel_mut(&memory);
let return_value = memory
.grow(delta, Some(fuel), resource_limiter)
.map(u32::from);
let return_value = memory.grow(delta, Some(fuel), resource_limiter);
let return_value = match return_value {
Ok(return_value) => {
// The `memory.grow` operation might have invalidated the cached
Expand Down
2 changes: 0 additions & 2 deletions crates/wasmi/src/engine/resumable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ impl ResumableInvocation {
self.engine
.clone()
.resume_func(ctx.as_context_mut(), self, inputs, outputs)
.map_err(Into::into)
.map(ResumableCall::new)
}
}
Expand Down Expand Up @@ -305,7 +304,6 @@ impl<Results> TypedResumableInvocation<Results> {
inputs,
<CallResultsTuple<Results>>::default(),
)
.map_err(Into::into)
.map(TypedResumableCall::new)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmi/src/engine/translator/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
finalize: impl FnOnce(CompiledFuncEntity),
) -> Result<T::Allocations, Error> {
self.translator.update_pos(offset);
self.translator.finish(finalize).map_err(Into::into)
self.translator.finish(finalize)
}

/// Translates local variables of the Wasm function.
Expand Down
1 change: 0 additions & 1 deletion crates/wasmi/src/func/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ impl Func {
.engine()
.clone()
.execute_func_resumable(ctx.as_context_mut(), self, inputs, outputs)
.map_err(Into::into)
.map(ResumableCall::new)
}

Expand Down

0 comments on commit 1432670

Please sign in to comment.