$ wasm-pack build [INFO]: 🎯 Checking for the Wasm target... [INFO]: 🌀 Compiling to Wasm... Compiling wasm-game-of-life v0.1.0 (/Users/admin/tmp/rust-webasm/wasm-game-of-life) error[E0277]: expected a `std::ops::FnMut<(web_sys::features::gen_Event::Event,)>` closure, found `[closure@src/lib.rs:64:50: 68:14 path:std::string::String, image:std::rc::Rc<std::cell::RefCell<web_sys::features::gen_HtmlImageElement::HtmlImageElement>>, images:std::rc::Rc<std::cell::RefCell<std::collections::HashMap<std::string::String, web_sys::features::gen_HtmlImageElement::HtmlImageElement>>>]` --> src/lib.rs:64:41 | 64 | let closure = Closure::wrap(Box::new(move |_event: web_sys::Event| { | _________________________________________^ 65 | | web_sys::console::log_1(&format!("Image loaded: {}", &path).into()); 66 | | let image = Rc::try_unwrap(image_dup).unwrap().into_inner(); 67 | | images.borrow_mut().insert(path, image); 68 | | }) as Box<dyn FnMut(web_sys::Event)>); | |______________^ expected an `FnMut<(web_sys::features::gen_Event::Event,)>` closure, found `[closure@src/lib.rs:64:50: 68:14 path:std::string::String, image:std::rc::Rc<std::cell::RefCell<web_sys::features::gen_HtmlImageElement::HtmlImageElement>>, images:std::rc::Rc<std::cell::RefCell<std::collections::HashMap<std::string::String, web_sys::features::gen_HtmlImageElement::HtmlImageElement>>>]` | = help: the trait `std::ops::FnMut<(web_sys::features::gen_Event::Event,)>` is not implemented for `[closure@src/lib.rs:64:50: 68:14 path:std::string::String, image:std::rc::Rc<std::cell::RefCell<web_sys::features::gen_HtmlImageElement::HtmlImageElement>>, images:std::rc::Rc<std::cell::RefCell<std::collections::HashMap<std::string::String, web_sys::features::gen_HtmlImageElement::HtmlImageElement>>>]` = note: required for the cast to the object type `dyn std::ops::FnMut(web_sys::features::gen_Event::Event)`
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0277`. error: could not compile `wasm-game-of-life`.
To learn more, run the command again with --verbose. Error: Compiling your crate to WebAssembly failed Caused by: failed to execute `cargo build`: exited with exit code: 101 full command: "cargo""build""--lib""--release""--target""wasm32-unknown-unknown"