···1[package]
002name = "dice-wire"
3version = "0.1.0"
4-edition = "2024"
56[lib]
7-crate-type = ["cdylib", "rlib"]
8-9-[features]
10-default = ["console_error_panic_hook"]
1112[dependencies]
13-wasm-bindgen = "0.2.84"
14-15-# The `console_error_panic_hook` crate provides better debugging of panics by
16-# logging them with `console.error`. This is great for development, but requires
17-# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
18-# code size when deploying.
19-console_error_panic_hook = { version = "0.1.7", optional = true }
20-21-[dev-dependencies]
22-wasm-bindgen-test = "0.3.34"
23-24-[profile.release]
25-# Tell `rustc` to optimize for small code size.
26-opt-level = "s"
···1-pub fn set_panic_hook() {
2- // When the `console_error_panic_hook` feature is enabled, we can call the
3- // `set_panic_hook` function at least once during initialization, and then
4- // we will get better error messages if our code ever panics.
5- //
6- // For more details see
7- // https://github.com/rustwasm/console_error_panic_hook#readme
8- #[cfg(feature = "console_error_panic_hook")]
9- console_error_panic_hook::set_once();
10-}