Skip to content

Commit

Permalink
cleanup parameters in translate (#822)
Browse files Browse the repository at this point in the history
* cleanup parameters in translate

* apply rustfmt
  • Loading branch information
Robbepop authored Dec 2, 2023
1 parent 0f4eea9 commit 6abc951
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions crates/wasmi/src/module/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,14 @@ mod block_type;
/// If the function body fails to validate.
pub fn translate<'parser>(
func: FuncIdx,
compiled_func_2: CompiledFunc,
compiled_func: CompiledFunc,
func_body: FunctionBody<'parser>,
validator: FuncValidator<ValidatorResources>,
res: ModuleResources<'parser>,
allocations: FuncTranslatorAllocations,
) -> Result<ReusableAllocations, ModuleError> {
FunctionTranslator::new(
func,
compiled_func_2,
func_body,
validator,
res,
allocations,
)?
.translate()
FunctionTranslator::new(func, compiled_func, func_body, validator, res, allocations)?
.translate()
}

/// Translates Wasm bytecode into `wasmi` bytecode for a single Wasm function.
Expand All @@ -52,14 +45,14 @@ impl<'parser> FunctionTranslator<'parser> {
/// Creates a new Wasm to `wasmi` bytecode function translator.
fn new(
func: FuncIdx,
compiled_func_2: CompiledFunc,
compiled_func: CompiledFunc,
func_body: FunctionBody<'parser>,
validator: FuncValidator<ValidatorResources>,
res: ModuleResources<'parser>,
allocations: FuncTranslatorAllocations,
) -> Result<Self, ModuleError> {
let func_builder =
ValidatingFuncTranslator::new(func, compiled_func_2, res, validator, allocations)?;
ValidatingFuncTranslator::new(func, compiled_func, res, validator, allocations)?;
Ok(Self {
func_body,
func_builder,
Expand Down

0 comments on commit 6abc951

Please sign in to comment.