File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,8 +327,10 @@ pub enum Module {
327327}
328328
329329pub enum Instance {
330- Wasm ( super :: wasmtime:: ModuleInstance ) ,
331- Js ( super :: v8:: JsInstance ) ,
330+ // Box these instances because they're very different sizes,
331+ // which makes Clippy sad and angry.
332+ Wasm ( Box < super :: wasmtime:: ModuleInstance > ) ,
333+ Js ( Box < super :: v8:: JsInstance > ) ,
332334}
333335
334336impl Module {
@@ -354,8 +356,8 @@ impl Module {
354356 }
355357 fn create_instance ( & self ) -> Instance {
356358 match self {
357- Module :: Wasm ( module) => Instance :: Wasm ( module. create_instance ( ) ) ,
358- Module :: Js ( module) => Instance :: Js ( module. create_instance ( ) ) ,
359+ Module :: Wasm ( module) => Instance :: Wasm ( Box :: new ( module. create_instance ( ) ) ) ,
360+ Module :: Js ( module) => Instance :: Js ( Box :: new ( module. create_instance ( ) ) ) ,
359361 }
360362 }
361363 fn host_type ( & self ) -> HostType {
You can’t perform that action at this time.
0 commit comments