diff --git a/lib/wasm/src/translation_utils.rs b/lib/wasm/src/translation_utils.rs index d76d55494f..cc2926dad1 100644 --- a/lib/wasm/src/translation_utils.rs +++ b/lib/wasm/src/translation_utils.rs @@ -92,13 +92,13 @@ pub struct Memory { /// Helper function translating wasmparser types to Cranelift types when possible. pub fn type_to_type(ty: wasmparser::Type) -> Result { - match ty { - wasmparser::Type::I32 => Ok(ir::types::I32), - wasmparser::Type::I64 => Ok(ir::types::I64), - wasmparser::Type::F32 => Ok(ir::types::F32), - wasmparser::Type::F64 => Ok(ir::types::F64), - _ => Err(()), - } + Ok(match ty { + wasmparser::Type::I32 => ir::types::I32, + wasmparser::Type::I64 => ir::types::I64, + wasmparser::Type::F32 => ir::types::F32, + wasmparser::Type::F64 => ir::types::F64, + _ => return Err(()), + }) } /// Turns a `wasmparser` `f32` into a `Cranelift` one.