Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary type conversions #1325

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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