Skip to content

Commit 7120968

Browse files
committed
Use unwrap_call instead of an explicit match
1 parent c7021ba commit 7120968

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

crates/cli-support/src/descriptors.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,9 @@ impl WasmBindgenDescriptorsSection {
148148
walrus::FunctionKind::Local(l) => l,
149149
_ => unreachable!(),
150150
};
151-
match local.get_mut(call_instr) {
152-
Expr::Call(e) => {
153-
assert_eq!(e.func, wbindgen_describe_closure);
154-
e.func = id;
155-
}
156-
_ => unreachable!(),
157-
}
151+
let call = local.get_mut(call_instr).unwrap_call_mut();
152+
assert_eq!(call.func, wbindgen_describe_closure);
153+
call.func = id;
158154
self.closure_imports
159155
.insert(import_id, descriptor.unwrap_closure());
160156
}

0 commit comments

Comments
 (0)