From 70f8288ec955756614902c361c684d83ade6aa61 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 29 Jan 2021 12:18:21 -0800 Subject: [PATCH] wasmtime-wiggle: take an Rc> instead of construct one so that if users wish to share a ctx between modules they may! --- crates/wiggle/wasmtime/macro/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/wiggle/wasmtime/macro/src/lib.rs b/crates/wiggle/wasmtime/macro/src/lib.rs index b2e6303887..7f13308f16 100644 --- a/crates/wiggle/wasmtime/macro/src/lib.rs +++ b/crates/wiggle/wasmtime/macro/src/lib.rs @@ -122,8 +122,7 @@ contained in the `cx` parameter.", impl #type_name { #[doc = #constructor_docs] - pub fn new(store: &wasmtime::Store, cx: #ctx_type) -> Self { - let cx = std::rc::Rc::new(std::cell::RefCell::new(cx)); + pub fn new(store: &wasmtime::Store, cx: std::rc::Rc>) -> Self { #(#ctor_externs)* Self {