From 71209686e9fc200ce40759895c1f163cad7ad38c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 4 Jun 2019 07:20:39 -0700 Subject: [PATCH] Use `unwrap_call` instead of an explicit `match` --- crates/cli-support/src/descriptors.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/cli-support/src/descriptors.rs b/crates/cli-support/src/descriptors.rs index 4752aab9..aef97a14 100644 --- a/crates/cli-support/src/descriptors.rs +++ b/crates/cli-support/src/descriptors.rs @@ -148,13 +148,9 @@ impl WasmBindgenDescriptorsSection { walrus::FunctionKind::Local(l) => l, _ => unreachable!(), }; - match local.get_mut(call_instr) { - Expr::Call(e) => { - assert_eq!(e.func, wbindgen_describe_closure); - e.func = id; - } - _ => unreachable!(), - } + let call = local.get_mut(call_instr).unwrap_call_mut(); + assert_eq!(call.func, wbindgen_describe_closure); + call.func = id; self.closure_imports .insert(import_id, descriptor.unwrap_closure()); }