diff --git a/bindings/java/src/lib.rs b/bindings/java/src/lib.rs index 746c45ad..84c0bce0 100644 --- a/bindings/java/src/lib.rs +++ b/bindings/java/src/lib.rs @@ -26,13 +26,12 @@ pub fn java_iterator_for_each jni::errors::Result<()>>(env: /// Wraps a Rust function, converting both Result::Err and panic into instances of Java's RuntimeException. /// Please use this on all native methods, otherwise a Rust panic/unwrap will crash the Java UI instead of popping a dialog box with the message. -#[allow(deprecated)] pub fn with_thrown_errors jni::errors::Result + UnwindSafe>(env: &JNIEnv, f: F) -> A { - use std::panic::{set_hook, take_hook, PanicInfo}; + use std::panic::{set_hook, take_hook, PanicHookInfo}; let old_hook = take_hook(); let (tx, rx) = std::sync::mpsc::channel::(); let mtx = std::sync::Mutex::new(tx); - set_hook(Box::new(move |info: &PanicInfo| { + set_hook(Box::new(move |info: &PanicHookInfo| { let mut msg = format!("Panic at {:?}", info.location()); if let Some(e) = info.payload().downcast_ref::<&str>() { msg += &*format!(": {e:?}"); diff --git a/web-app/Cargo.toml b/web-app/Cargo.toml index 25c984f6..b153f8a8 100644 --- a/web-app/Cargo.toml +++ b/web-app/Cargo.toml @@ -18,3 +18,6 @@ derivative = "2.2.0" [lib] crate-type = ["cdylib", "rlib"] + +[package.metadata.wasm-pack.profile.release] +wasm-opt = ["-Oz", "--enable-mutable-globals", "--enable-bulk-memory"] \ No newline at end of file