summaryrefslogtreecommitdiff
path: root/crates/parser/src/visit.rs
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2025-05-06 21:36:25 +0200
committerHenry Gressmann <mail@henrygressmann.de>2025-05-06 21:36:25 +0200
commitf9f760f487cfb08aa7992439bf748f7dcd46466b (patch)
tree8d08b92b30eab6e4b107ecfc2fd65a1f3603f411 /crates/parser/src/visit.rs
parent0f3581ef8fdb55ad21fdfd132eaefadaec242f85 (diff)
chore: cleanup
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/visit.rs')
-rw-r--r--crates/parser/src/visit.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/parser/src/visit.rs b/crates/parser/src/visit.rs
index 1635d2d..4ae2cc1 100644
--- a/crates/parser/src/visit.rs
+++ b/crates/parser/src/visit.rs
@@ -370,17 +370,13 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
let if_instruction = &mut self.instructions[if_label_pointer];
- let (else_offset, end_offset) = match if_instruction {
- Instruction::If(else_offset, end_offset)
- | Instruction::IfWithFuncType(_, else_offset, end_offset)
- | Instruction::IfWithType(_, else_offset, end_offset) => (else_offset, end_offset),
- _ => {
- self.errors.push(crate::ParseError::UnsupportedOperator(
- "Expected to end an if block, but the last label was not an if".to_string(),
- ));
-
- return;
- }
+ let (Instruction::If(else_offset, end_offset)
+ | Instruction::IfWithFuncType(_, else_offset, end_offset)
+ | Instruction::IfWithType(_, else_offset, end_offset)) = if_instruction
+ else {
+ return self.errors.push(crate::ParseError::UnsupportedOperator(
+ "Expected to end an if block, but the last label was not an if".to_string(),
+ ));
};
*else_offset = (label_pointer - if_label_pointer)