moon_engine/
utils.rs

1//! Utilities that make working with Rust and WASM much easier.
2
3/// When the `console_error_panic_hook` feature is enabled, we can call the
4/// `set_panic_hook` function at least once during initialization, and then
5/// we will get better error messages if our code ever panics.
6///
7/// For more details see
8/// <https://github.com/rustwasm/console_error_panic_hook#readme>
9pub fn set_panic_hook() {
10    #[cfg(feature = "console_error_panic_hook")]
11    console_error_panic_hook::set_once();
12}