Skip to content

Commit af591f8

Browse files
committed
Clippy
1 parent e22d3cd commit af591f8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

crates/core/src/host/module_host.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ pub enum Module {
327327
}
328328

329329
pub 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

334336
impl 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 {

0 commit comments

Comments
 (0)